Interface FabricClientCommandSource

All Superinterfaces:
CommandSource

public interface FabricClientCommandSource extends CommandSource
Extensions to CommandSource for client-sided commands.
  • Method Details

    • sendFeedback

      void sendFeedback(Text message)
      Sends a feedback message to the player.
      Parameters:
      message - the feedback message
    • sendError

      void sendError(Text message)
      Sends an error message to the player.
      Parameters:
      message - the error message
    • getClient

      MinecraftClient getClient()
      Gets the client instance used to run the command.
      Returns:
      the client
    • getPlayer

      ClientPlayerEntity getPlayer()
      Gets the player that used the command.
      Returns:
      the player
    • getEntity

      default Entity getEntity()
      Gets the entity that used the command.
      Returns:
      the entity
    • getPosition

      default Vec3d getPosition()
      Gets the position from where the command has been executed.
      Returns:
      the position
    • getRotation

      default Vec2f getRotation()
      Gets the rotation of the entity that used the command.
      Returns:
      the rotation
    • getWorld

      ClientWorld getWorld()
      Gets the world where the player used the command.
      Returns:
      the world
    • getMeta

      default Object getMeta(String key)
      Gets the meta property under key that was assigned to this source.

      This method should return the same result for every call with the same key.

      Parameters:
      key - the meta key
      Returns:
      the meta