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
Interface for commands, uses Mojang's Brigadier command framework, @see .
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
     
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final int
     
  • Method Summary

    Modifier and Type
    Method
    Description
    default com.mojang.brigadier.builder.LiteralArgumentBuilder<net.minecraft.commands.CommandSourceStack>
    Builds the command, overwrite and add further arguments etc for nonsimple commands.
    default boolean
    checkPreCondition(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context)
    Preconditions to check before executing
    default int
    checkPreConditionAndExecute(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context)
    Executes pre-checks before issuing the command
    default int
    checkPreConditionAndExecute(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context, IMCCommand.ExecutionHandler onExecute)
    Executes pre-checks before issuing the command
    Name string of the command.
    static boolean
    isPlayerOped(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>
    Helper function for typing.
    int
    onExecute(com.mojang.brigadier.context.CommandContext<net.minecraft.commands.CommandSourceStack> context)
    What happens when the command is executed after preConditions are successful.
  • Field Details

  • 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)