Interface FabricClientCommandSource

All Superinterfaces:
CommandSource

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

    • sendFeedback Link icon

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

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

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

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

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

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

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

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

      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