Interface FabricClientCommandSource
- All Superinterfaces:
CommandSource
Extensions to
CommandSource
for client-sided commands.-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.command.CommandSource
CommandSource.RelativePosition, CommandSource.SuggestedIdType
-
Method Summary
Modifier and TypeMethodDescriptionGets the client instance used to run the command.default Entity
Gets the entity that used the command.default Object
Gets the meta property underkey
that was assigned to this source.Gets the player that used the command.default Vec3d
Gets the position from where the command has been executed.default Vec2f
Gets the rotation of the entity that used the command.getWorld()
Gets the world where the player used the command.void
Sends an error message to the player.void
sendFeedback
(Text message) Sends a feedback message to the player.Methods inherited from interface net.minecraft.command.CommandSource
getBlockPositionSuggestions, getChatSuggestions, getCompletions, getEntitySuggestions, getPlayerNames, getPositionSuggestions, getRecipeIds, getRegistryManager, getSoundIds, getTeamNames, getWorldKeys, hasPermissionLevel, listIdSuggestions, suggestIdentifiers
-
Method Details
-
sendFeedback
Sends a feedback message to the player.- Parameters:
message
- the feedback message
-
sendError
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
Gets the entity that used the command.- Returns:
- the entity
-
getPosition
Gets the position from where the command has been executed.- Returns:
- the position
-
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
Gets the meta property underkey
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
-