Package net.minecraft.command
Class CommandSource
java.lang.Object
net.minecraft.command.CommandSource
- All Implemented Interfaces:
ISuggestionProvider
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.command.ISuggestionProvider
ISuggestionProvider.Coordinates
-
Field Summary
Modifier and TypeFieldDescriptionprivate final EntityAnchorArgument.Type
private final com.mojang.brigadier.ResultConsumer<CommandSource>
private final ITextComponent
private final Entity
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
private final ServerWorld
private final int
private final Vector2f
private final MinecraftServer
private final boolean
private final ICommandSource
private final String
private final Vector3d
-
Constructor Summary
ModifierConstructorDescriptionCommandSource
(ICommandSource p_i49552_1_, Vector3d p_i49552_2_, Vector2f p_i49552_3_, ServerWorld p_i49552_4_, int p_i49552_5_, String p_i49552_6_, ITextComponent p_i49552_7_, MinecraftServer p_i49552_8_, Entity p_i49552_9_) protected
CommandSource
(ICommandSource p_i49553_1_, Vector3d p_i49553_2_, Vector2f p_i49553_3_, ServerWorld p_i49553_4_, int p_i49553_5_, String p_i49553_6_, ITextComponent p_i49553_7_, MinecraftServer p_i49553_8_, Entity p_i49553_9_, boolean p_i49553_10_, com.mojang.brigadier.ResultConsumer<CommandSource> p_i49553_11_, EntityAnchorArgument.Type p_i49553_12_) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
broadcastToAdmins
(ITextComponent p_197020_1_) CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
customSuggestion
(com.mojang.brigadier.context.CommandContext<ISuggestionProvider> p_197009_1_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_197009_2_) facing
(Entity p_201006_1_, EntityAnchorArgument.Type p_201006_2_) getLevel()
boolean
hasPermission
(int p_197034_1_) levels()
void
onCommandComplete
(com.mojang.brigadier.context.CommandContext<CommandSource> p_197038_1_, boolean p_197038_2_, int p_197038_3_) void
sendFailure
(ITextComponent p_197021_1_) void
sendSuccess
(ITextComponent p_197030_1_, boolean p_197030_2_) withAnchor
(EntityAnchorArgument.Type p_201010_1_) withCallback
(com.mojang.brigadier.ResultConsumer<CommandSource> p_197029_1_) withCallback
(com.mojang.brigadier.ResultConsumer<CommandSource> p_209550_1_, BinaryOperator<com.mojang.brigadier.ResultConsumer<CommandSource>> p_209550_2_) withEntity
(Entity p_197024_1_) withLevel
(ServerWorld p_201003_1_) withMaximumPermission
(int p_197026_1_) withPermission
(int p_197033_1_) withPosition
(Vector3d p_201009_1_) withRotation
(Vector2f p_201007_1_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.command.ISuggestionProvider
getAbsoluteCoordinates, getRelevantCoordinates, getSelectedEntities
-
Field Details
-
ERROR_NOT_PLAYER
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NOT_PLAYER -
ERROR_NOT_ENTITY
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_NOT_ENTITY -
source
-
worldPosition
-
level
-
permissionLevel
private final int permissionLevel -
textName
-
displayName
-
server
-
silent
private final boolean silent -
entity
-
consumer
-
anchor
-
rotation
-
-
Constructor Details
-
CommandSource
public CommandSource(ICommandSource p_i49552_1_, Vector3d p_i49552_2_, Vector2f p_i49552_3_, ServerWorld p_i49552_4_, int p_i49552_5_, String p_i49552_6_, ITextComponent p_i49552_7_, MinecraftServer p_i49552_8_, @Nullable Entity p_i49552_9_) -
CommandSource
protected CommandSource(ICommandSource p_i49553_1_, Vector3d p_i49553_2_, Vector2f p_i49553_3_, ServerWorld p_i49553_4_, int p_i49553_5_, String p_i49553_6_, ITextComponent p_i49553_7_, MinecraftServer p_i49553_8_, @Nullable Entity p_i49553_9_, boolean p_i49553_10_, com.mojang.brigadier.ResultConsumer<CommandSource> p_i49553_11_, EntityAnchorArgument.Type p_i49553_12_)
-
-
Method Details
-
withEntity
-
withPosition
-
withRotation
-
withCallback
-
withCallback
public CommandSource withCallback(com.mojang.brigadier.ResultConsumer<CommandSource> p_209550_1_, BinaryOperator<com.mojang.brigadier.ResultConsumer<CommandSource>> p_209550_2_) -
withSuppressedOutput
-
withPermission
-
withMaximumPermission
-
withAnchor
-
withLevel
-
facing
public CommandSource facing(Entity p_201006_1_, EntityAnchorArgument.Type p_201006_2_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
facing
public CommandSource facing(Vector3d p_201005_1_) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getDisplayName
-
getTextName
-
hasPermission
public boolean hasPermission(int p_197034_1_) - Specified by:
hasPermission
in interfaceISuggestionProvider
-
getPosition
-
getLevel
-
getEntity
-
getEntityOrException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getPlayerOrException
public ServerPlayerEntity getPlayerOrException() throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getRotation
-
getServer
-
getAnchor
-
sendSuccess
-
broadcastToAdmins
-
sendFailure
-
onCommandComplete
public void onCommandComplete(com.mojang.brigadier.context.CommandContext<CommandSource> p_197038_1_, boolean p_197038_2_, int p_197038_3_) -
getOnlinePlayerNames
- Specified by:
getOnlinePlayerNames
in interfaceISuggestionProvider
-
getAllTeams
- Specified by:
getAllTeams
in interfaceISuggestionProvider
-
getAvailableSoundEvents
- Specified by:
getAvailableSoundEvents
in interfaceISuggestionProvider
-
getRecipeNames
- Specified by:
getRecipeNames
in interfaceISuggestionProvider
-
customSuggestion
public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> customSuggestion(com.mojang.brigadier.context.CommandContext<ISuggestionProvider> p_197009_1_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_197009_2_) - Specified by:
customSuggestion
in interfaceISuggestionProvider
-
levels
- Specified by:
levels
in interfaceISuggestionProvider
-
registryAccess
- Specified by:
registryAccess
in interfaceISuggestionProvider
-