-
Notifications
You must be signed in to change notification settings - Fork 10
CommandUtils
youyihj edited this page Jan 24, 2022
·
4 revisions
CommandUtils provide some static methods to help you to get player, entity that command acts on or notify command sender that he called command in wrong usage.
You'd better import the package to avoid errors and write script easier.
import mods.zenutils.command.CommandUtils;
IPlayer getCommandSenderAsPlayer(ZenUtilsCommandSender sender);
IPlayer getPlayer(IServer server, ZenUtilsCommandSender sender, String target);
List<IPlayer> getPlayers(IServer server, ZenUtilsCommandSender sender, String target);
IEntity getEntity(IServer server, ZenUtilsCommandSender sender, String target);
List<IEntity> getEntityList(IServer server, ZenUtilsCommandSender sender, String target);
IItemDefinition getItemByText(ZenUtilsCommandSender sender, String id)
IBlockDefinition getBlockByText(ZenUtilsCommandSender sender, String id)
The method throws WrongUsageException internally, so calling it will stop command from executing.
void notifyWrongUsage(String unlocalizedName);
void notifyWrongUsage(String unlocalizedName, String... replacements)
void notifyWrongUsage(ZenCommand command, ZenUtilsCommandSender sender); // call ZenCommand::getCommandUsage function internally
- GlobalFunctions
- ScriptReloading
- SuppressErrorPreprocessor
- HardFailPreprocessor
- OrderlyMap
- IData Deep Update
- Template String
- Native Method Access
- Mixin
- CrTI18n
- CrTUUID
- CrTItemHandler
- CrTLiquidHandler
- ILiquidTankProperties
- StringList
- HexHelper
- StaticString
- Catenation
- PersistedCatenation
- PlayerStat
- IStatFormatter
- GameRuleHelper
- ZenCommand
- ZenCommandTree
- ZenUtilsCommandSender
- IGetCommandUsage
- ICommandExecute
- IGetTabCompletion
- CommandUtils