Interface FabricClientCommandSource

All Superinterfaces:
net.minecraft.command.CommandSource

@Environment(CLIENT) public interface FabricClientCommandSource extends net.minecraft.command.CommandSource
Extensions to CommandSource for client-sided commands.
  • Nested Class Summary

    Nested classes/interfaces inherited from interface net.minecraft.command.CommandSource

    net.minecraft.command.CommandSource.class_7078, net.minecraft.command.CommandSource.RelativePosition
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.client.MinecraftClient
    Gets the client instance used to run the command.
    default net.minecraft.entity.Entity
    Gets the entity that used the command.
    default Object
    Gets the meta property under key that was assigned to this source.
    net.minecraft.client.network.ClientPlayerEntity
    Gets the player that used the command.
    default net.minecraft.util.math.Vec3d
    Gets the position from where the command has been executed.
    default net.minecraft.util.math.Vec2f
    Gets the rotation of the entity that used the command.
    net.minecraft.client.world.ClientWorld
    Gets the world where the player used the command.
    void
    sendError(net.minecraft.text.Text message)
    Sends an error message to the player.
    void
    sendFeedback(net.minecraft.text.Text message)
    Sends a feedback message to the player.

    Methods inherited from interface net.minecraft.command.CommandSource

    getBlockPositionSuggestions, getCompletions, getEntitySuggestions, getPlayerNames, getPositionSuggestions, getRecipeIds, getRegistryManager, getSoundIds, getTeamNames, getWorldKeys, hasPermissionLevel, method_41213, method_41214
  • Method Details

    • sendFeedback

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

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

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

      net.minecraft.client.network.ClientPlayerEntity getPlayer()
      Gets the player that used the command.
      Returns:
      the player
    • getEntity

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

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

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

      net.minecraft.client.world.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