Package net.minecraft.commands
Class CommandSourceStack
java.lang.Object
net.minecraft.commands.CommandSourceStack
- All Implemented Interfaces:
SharedSuggestionProvider
,IForgeCommandSourceStack
- Direct Known Subclasses:
ClientCommandSourceStack
public class CommandSourceStack
extends Object
implements SharedSuggestionProvider, IForgeCommandSourceStack
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.commands.SharedSuggestionProvider
SharedSuggestionProvider.ElementSuggestionType, SharedSuggestionProvider.TextCoordinates
-
Field Summary
Modifier and TypeFieldDescriptionprivate final EntityAnchorArgument.Anchor
private final TaskChainer
private final com.mojang.brigadier.ResultConsumer<CommandSourceStack>
private final Component
private final Entity
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
private final ServerLevel
private final int
private final Vec2
private final MinecraftServer
private final CommandSigningContext
private final boolean
final CommandSource
private final String
private final Vec3
-
Constructor Summary
ModifierConstructorDescriptionCommandSourceStack
(CommandSource p_81302_, Vec3 p_81303_, Vec2 p_81304_, ServerLevel p_81305_, int p_81306_, String p_81307_, Component p_81308_, MinecraftServer p_81309_, Entity p_81310_) protected
CommandSourceStack
(CommandSource p_242362_, Vec3 p_242272_, Vec2 p_242166_, ServerLevel p_242273_, int p_242279_, String p_242187_, Component p_242467_, MinecraftServer p_242416_, Entity p_242300_, boolean p_242243_, com.mojang.brigadier.ResultConsumer<CommandSourceStack> p_242375_, EntityAnchorArgument.Anchor p_242201_, CommandSigningContext p_242188_, TaskChainer p_242249_) -
Method Summary
Modifier and TypeMethodDescriptionprivate void
broadcastToAdmins
(Component p_81367_) CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
customSuggestion
(com.mojang.brigadier.context.CommandContext<?> p_212324_) facing
(Entity p_81332_, EntityAnchorArgument.Anchor p_81333_) getLevel()
boolean
hasPermission
(int p_81370_) boolean
isPlayer()
levels()
void
onCommandComplete
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_81343_, boolean p_81344_, int p_81345_) void
sendChatMessage
(OutgoingPlayerChatMessage p_243226_, boolean p_243216_, ChatType.Bound p_243244_) void
sendFailure
(Component p_81353_) void
sendSuccess
(Component p_81355_, boolean p_81356_) void
sendSystemMessage
(Component p_243331_) boolean
shouldFilterMessageTo
(ServerPlayer p_243268_) CompletableFuture<com.mojang.brigadier.suggestion.Suggestions>
suggestRegistryElements
(ResourceKey<? extends Registry<?>> p_212330_, SharedSuggestionProvider.ElementSuggestionType p_212331_, com.mojang.brigadier.suggestion.SuggestionsBuilder p_212332_, com.mojang.brigadier.context.CommandContext<?> p_212333_) withAnchor
(EntityAnchorArgument.Anchor p_81351_) withCallback
(com.mojang.brigadier.ResultConsumer<CommandSourceStack> p_81335_) withCallback
(com.mojang.brigadier.ResultConsumer<CommandSourceStack> p_81337_, BinaryOperator<com.mojang.brigadier.ResultConsumer<CommandSourceStack>> p_81338_) withChatMessageChainer
(TaskChainer p_242228_) withEntity
(Entity p_81330_) withLevel
(ServerLevel p_81328_) withMaximumPermission
(int p_81359_) withPermission
(int p_81326_) withPosition
(Vec3 p_81349_) withRotation
(Vec2 p_81347_) withSigningContext
(CommandSigningContext p_230894_) withSource
(CommandSource p_165485_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraftforge.common.extensions.IForgeCommandSourceStack
getAdvancement, getRecipeManager, getScoreboard, getUnsidedLevel
Methods inherited from interface net.minecraft.commands.SharedSuggestionProvider
getAbsoluteCoordinates, getCustomTabSugggestions, getRelevantCoordinates, getSelectedEntities, suggestRegistryElements
-
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
-
signingContext
-
chatMessageChainer
-
-
Constructor Details
-
CommandSourceStack
public CommandSourceStack(CommandSource p_81302_, Vec3 p_81303_, Vec2 p_81304_, ServerLevel p_81305_, int p_81306_, String p_81307_, Component p_81308_, MinecraftServer p_81309_, @Nullable Entity p_81310_) -
CommandSourceStack
protected CommandSourceStack(CommandSource p_242362_, Vec3 p_242272_, Vec2 p_242166_, ServerLevel p_242273_, int p_242279_, String p_242187_, Component p_242467_, MinecraftServer p_242416_, @Nullable Entity p_242300_, boolean p_242243_, @Nullable com.mojang.brigadier.ResultConsumer<CommandSourceStack> p_242375_, EntityAnchorArgument.Anchor p_242201_, CommandSigningContext p_242188_, TaskChainer p_242249_)
-
-
Method Details
-
withSource
-
withEntity
-
withPosition
-
withRotation
-
withCallback
public CommandSourceStack withCallback(com.mojang.brigadier.ResultConsumer<CommandSourceStack> p_81335_) -
withCallback
public CommandSourceStack withCallback(com.mojang.brigadier.ResultConsumer<CommandSourceStack> p_81337_, BinaryOperator<com.mojang.brigadier.ResultConsumer<CommandSourceStack>> p_81338_) -
withSuppressedOutput
-
withPermission
-
withMaximumPermission
-
withAnchor
-
withLevel
-
facing
-
facing
-
withSigningContext
-
withChatMessageChainer
-
getDisplayName
-
getTextName
-
asChatSender
-
hasPermission
public boolean hasPermission(int p_81370_) - Specified by:
hasPermission
in interfaceSharedSuggestionProvider
-
getPosition
-
getLevel
-
getEntity
-
getEntityOrException
- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getPlayerOrException
public ServerPlayer getPlayerOrException() throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getPlayer
-
isPlayer
public boolean isPlayer() -
getRotation
-
getServer
-
getAnchor
-
getSigningContext
-
getChatMessageChainer
-
shouldFilterMessageTo
-
sendChatMessage
public void sendChatMessage(OutgoingPlayerChatMessage p_243226_, boolean p_243216_, ChatType.Bound p_243244_) -
sendSystemMessage
-
sendSuccess
-
broadcastToAdmins
-
sendFailure
-
onCommandComplete
public void onCommandComplete(com.mojang.brigadier.context.CommandContext<CommandSourceStack> p_81343_, boolean p_81344_, int p_81345_) -
getOnlinePlayerNames
- Specified by:
getOnlinePlayerNames
in interfaceSharedSuggestionProvider
-
getAllTeams
- Specified by:
getAllTeams
in interfaceSharedSuggestionProvider
-
getAvailableSoundEvents
- Specified by:
getAvailableSoundEvents
in interfaceSharedSuggestionProvider
-
getRecipeNames
- Specified by:
getRecipeNames
in interfaceSharedSuggestionProvider
-
customSuggestion
public CompletableFuture<com.mojang.brigadier.suggestion.Suggestions> customSuggestion(com.mojang.brigadier.context.CommandContext<?> p_212324_) - Specified by:
customSuggestion
in interfaceSharedSuggestionProvider
-
levels
- Specified by:
levels
in interfaceSharedSuggestionProvider
-
registryAccess
- Specified by:
registryAccess
in interfaceSharedSuggestionProvider
-