Interface IMCCommand
- All Known Subinterfaces:
IMCColonyOfficerCommand,IMCOPCommand
- All Known Implementing Classes:
CommandAddOfficer,CommandBackup,CommandCanRaiderSpawn,CommandChangeOwner,CommandCitizenInfo,CommandCitizenKill,CommandCitizenList,CommandCitizenModify,CommandCitizenReload,CommandCitizenSpawnNew,CommandCitizenTeleport,CommandCitizenTrack,CommandCitizenTriggerWalkTo,CommandClaimChunks,CommandColonyChunks,CommandColonyInfo,CommandColonyPrintStats,CommandColonyRaidsInfo,CommandColonyResetStats,CommandDeleteColony,CommandEntityTrack,CommandExportColony,CommandGetRanks,CommandHelp,CommandHomeTeleport,CommandKillAnimal,CommandKillChicken,CommandKillCow,CommandKillMonster,CommandKillPig,CommandKillRaider,CommandKillSheep,CommandListColonies,CommandLoadAllBackups,CommandLoadBackup,CommandPruneWorld,CommandRaid,CommandReclaimChunks,CommandResetPlayerSupplies,CommandRSReset,CommandRSResetAll,CommandSetAbandoned,CommandSetDeletable,CommandSetRank,CommandShowClaim,CommandTeleport,CommandToggleDebug,CommandTrackType,CommandUnloadForcedChunks,CommandWhereAmI,CommandWhoAmI
public interface IMCCommand
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptiondefault com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack> build()Builds the command, overwrite and add further arguments etc for nonsimple commands.default booleancheckPreCondition(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context) Preconditions to check before executingdefault intcheckPreConditionAndExecute(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context) Executes pre-checks before issuing the commanddefault intcheckPreConditionAndExecute(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context, IMCCommand.ExecutionHandler onExecute) Executes pre-checks before issuing the commandgetName()Name string of the command.static booleanisPlayerOped(net.minecraft.world.entity.player.Player player) static <T> com.mojang.brigadier.builder.RequiredArgumentBuilder<net.minecraft.commands.CommandSourceStack, T> newArgument(String name, com.mojang.brigadier.arguments.ArgumentType<T> type) static com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack> newLiteral(String name) Helper function for typing.intonExecute(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context) What happens when the command is executed after preConditions are successful.
-
Field Details
-
OP_PERM_LEVEL
static final int OP_PERM_LEVEL- See Also:
-
-
Method Details
-
build
default com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack> build()Builds the command, overwrite and add further arguments etc for nonsimple commands. When overwriting this make sure to check the preconditions.- Returns:
- the built command.
-
newLiteral
static com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack> newLiteral(String name) Helper function for typing.- Parameters:
name- name of the new command.- Returns:
- the builder.
-
newArgument
static <T> com.mojang.brigadier.builder.RequiredArgumentBuilder<net.minecraft.commands.CommandSourceStack,T> newArgument(String name, com.mojang.brigadier.arguments.ArgumentType<T> type) -
checkPreConditionAndExecute
default int checkPreConditionAndExecute(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context) Executes pre-checks before issuing the command- Parameters:
context- the context.- Returns:
- 1 if successful and 0 if incomplete.
-
checkPreConditionAndExecute
default int checkPreConditionAndExecute(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context, IMCCommand.ExecutionHandler onExecute) Executes pre-checks before issuing the command- Parameters:
context- the context.onExecute- the execution method.- Returns:
- 1 if successful and 0 if incomplete.
-
checkPreCondition
default boolean checkPreCondition(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context) Preconditions to check before executing- Parameters:
context- the command context.- Returns:
- true if fine.
-
onExecute
int onExecute(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context) What happens when the command is executed after preConditions are successful.- Parameters:
context- the context of the command execution- Returns:
- 1 if successful and 0 if incomplete.
-
getName
String getName()Name string of the command.- Returns:
- the name.
-
isPlayerOped
static boolean isPlayerOped(net.minecraft.world.entity.player.Player player)
-