Package net.minecraft.server.commands
Class ExecuteCommand
java.lang.Object
net.minecraft.server.commands.ExecuteCommand
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interface
(package private) static interface
(package private) static interface
(package private) static class
(package private) static interface
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType
static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType
private static final int
private static final com.mojang.brigadier.suggestion.SuggestionProvider
<CommandSourceStack> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static com.mojang.brigadier.builder.ArgumentBuilder
<CommandSourceStack, ?> addConditional
(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> pCommandNode, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> pBuilder, boolean pValue, ExecuteCommand.CommandPredicate pTest) private static com.mojang.brigadier.builder.ArgumentBuilder
<CommandSourceStack, ?> addConditionals
(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> pParent, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> pLiteral, boolean pIsIf, CommandBuildContext pContext) private static com.mojang.brigadier.builder.ArgumentBuilder
<CommandSourceStack, ?> addIfBlocksConditional
(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> pCommandNode, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> pLiteral, boolean pIsIf, boolean pIsMasked) private static boolean
checkCustomPredicate
(CommandSourceStack pSource, Holder<LootItemCondition> pCondition) private static int
checkIfRegions
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, boolean pIsMasked) private static int
checkMatchingData
(DataAccessor pAccessor, NbtPathArgument.NbtPath pPath) private static OptionalInt
checkRegions
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, boolean pIsMasked) private static OptionalInt
checkRegions
(ServerLevel pLevel, BlockPos pBegin, BlockPos pEnd, BlockPos pDestination, boolean pIsMasked) private static boolean
checkScore
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, MinMaxBounds.Ints pBounds) private static boolean
checkScore
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pSource, ExecuteCommand.IntBiPredicate pPredicate) private static int
checkUnlessRegions
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, boolean pIsMasked) private static int
private static int
countItems
(CommandSourceStack pSource, BlockPos pPos, SlotRange pSlotRange, Predicate<ItemStack> pFilter) private static com.mojang.brigadier.Command
<CommandSourceStack> createNumericConditionalHandler
(boolean pIsIf, ExecuteCommand.CommandNumericPredicate pPredicate) private static com.mojang.brigadier.builder.LiteralArgumentBuilder
<CommandSourceStack> createRelationOperations
(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> pNode, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> pArgumentBuilder) private static com.mojang.brigadier.RedirectModifier
<CommandSourceStack> expandOneToManyEntityRelation
(Function<Entity, Stream<Entity>> pRelation) private static com.mojang.brigadier.RedirectModifier
<CommandSourceStack> expandOneToOneEntityRelation
(Function<Entity, Optional<Entity>> pRelation) private static Collection
<CommandSourceStack> expect
(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, boolean pActual, boolean pExpected) If actual and expected match, returns a collection containing only the source player.private static boolean
isChunkLoaded
(ServerLevel pLevel, BlockPos pPos) static void
register
(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> pDispatcher, CommandBuildContext pContext) static <T extends ExecutionCommandSource<T>>
voidscheduleFunctionConditionsAndTest
(T pOriginalSource, List<T> pSources, Function<T, T> pSourceModifier, IntPredicate pSuccessCheck, com.mojang.brigadier.context.ContextChain<T> pContextChain, CompoundTag pArguments, ExecutionControl<T> pExecutionControl, ExecuteCommand.CommandGetter<T, Collection<CommandFunction<T>>> pFunctions, ChainModifiers pChainModifiers) private static CommandSourceStack
spawnEntityAndRedirect
(CommandSourceStack pSource, Holder.Reference<EntityType<?>> pEntityType) private static CommandSourceStack
storeData
(CommandSourceStack pSource, DataAccessor pAccessor, NbtPathArgument.NbtPath pPath, IntFunction<Tag> pTagConverter, boolean pStoringResult) private static CommandSourceStack
storeValue
(CommandSourceStack pSource, Collection<ScoreHolder> pTargets, Objective pObjective, boolean pStoringResult) private static CommandSourceStack
storeValue
(CommandSourceStack pSource, CustomBossEvent pBar, boolean pStoringValue, boolean pStoringResult) private static com.mojang.brigadier.builder.ArgumentBuilder
<CommandSourceStack, ?> wrapStores
(com.mojang.brigadier.tree.LiteralCommandNode<CommandSourceStack> pParent, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> pLiteral, boolean pStoringResult)
-
Field Details
-
MAX_TEST_AREA
private static final int MAX_TEST_AREA- See Also:
-
ERROR_AREA_TOO_LARGE
private static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_AREA_TOO_LARGE -
ERROR_CONDITIONAL_FAILED
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_CONDITIONAL_FAILED -
ERROR_CONDITIONAL_FAILED_COUNT
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_CONDITIONAL_FAILED_COUNT -
ERROR_FUNCTION_CONDITION_INSTANTATION_FAILURE
public static final com.mojang.brigadier.exceptions.Dynamic2CommandExceptionType ERROR_FUNCTION_CONDITION_INSTANTATION_FAILURE -
SUGGEST_PREDICATE
private static final com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> SUGGEST_PREDICATE
-
-
Constructor Details
-
ExecuteCommand
public ExecuteCommand()
-
-
Method Details
-
register
public static void register(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> pDispatcher, CommandBuildContext pContext) -
wrapStores
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack,?> wrapStores(com.mojang.brigadier.tree.LiteralCommandNode<CommandSourceStack> pParent, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> pLiteral, boolean pStoringResult) -
storeValue
private static CommandSourceStack storeValue(CommandSourceStack pSource, Collection<ScoreHolder> pTargets, Objective pObjective, boolean pStoringResult) -
storeValue
private static CommandSourceStack storeValue(CommandSourceStack pSource, CustomBossEvent pBar, boolean pStoringValue, boolean pStoringResult) -
storeData
private static CommandSourceStack storeData(CommandSourceStack pSource, DataAccessor pAccessor, NbtPathArgument.NbtPath pPath, IntFunction<Tag> pTagConverter, boolean pStoringResult) -
isChunkLoaded
-
addConditionals
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack,?> addConditionals(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> pParent, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> pLiteral, boolean pIsIf, CommandBuildContext pContext) -
countItems
-
countItems
private static int countItems(CommandSourceStack pSource, BlockPos pPos, SlotRange pSlotRange, Predicate<ItemStack> pFilter) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
createNumericConditionalHandler
private static com.mojang.brigadier.Command<CommandSourceStack> createNumericConditionalHandler(boolean pIsIf, ExecuteCommand.CommandNumericPredicate pPredicate) -
checkMatchingData
private static int checkMatchingData(DataAccessor pAccessor, NbtPathArgument.NbtPath pPath) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkScore
private static boolean checkScore(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pSource, ExecuteCommand.IntBiPredicate pPredicate) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkScore
private static boolean checkScore(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, MinMaxBounds.Ints pBounds) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkCustomPredicate
private static boolean checkCustomPredicate(CommandSourceStack pSource, Holder<LootItemCondition> pCondition) -
expect
private static Collection<CommandSourceStack> expect(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, boolean pActual, boolean pExpected) If actual and expected match, returns a collection containing only the source player. -
addConditional
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack,?> addConditional(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> pCommandNode, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> pBuilder, boolean pValue, ExecuteCommand.CommandPredicate pTest) -
addIfBlocksConditional
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack,?> addIfBlocksConditional(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> pCommandNode, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> pLiteral, boolean pIsIf, boolean pIsMasked) -
checkIfRegions
private static int checkIfRegions(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, boolean pIsMasked) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkUnlessRegions
private static int checkUnlessRegions(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, boolean pIsMasked) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkRegions
private static OptionalInt checkRegions(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, boolean pIsMasked) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
checkRegions
private static OptionalInt checkRegions(ServerLevel pLevel, BlockPos pBegin, BlockPos pEnd, BlockPos pDestination, boolean pIsMasked) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
expandOneToOneEntityRelation
private static com.mojang.brigadier.RedirectModifier<CommandSourceStack> expandOneToOneEntityRelation(Function<Entity, Optional<Entity>> pRelation) -
expandOneToManyEntityRelation
private static com.mojang.brigadier.RedirectModifier<CommandSourceStack> expandOneToManyEntityRelation(Function<Entity, Stream<Entity>> pRelation) -
createRelationOperations
private static com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> createRelationOperations(com.mojang.brigadier.tree.CommandNode<CommandSourceStack> pNode, com.mojang.brigadier.builder.LiteralArgumentBuilder<CommandSourceStack> pArgumentBuilder) -
spawnEntityAndRedirect
private static CommandSourceStack spawnEntityAndRedirect(CommandSourceStack pSource, Holder.Reference<EntityType<?>> pEntityType) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
scheduleFunctionConditionsAndTest
public static <T extends ExecutionCommandSource<T>> void scheduleFunctionConditionsAndTest(T pOriginalSource, List<T> pSources, Function<T, T> pSourceModifier, IntPredicate pSuccessCheck, com.mojang.brigadier.context.ContextChain<T> pContextChain, @Nullable CompoundTag pArguments, ExecutionControl<T> pExecutionControl, ExecuteCommand.CommandGetter<T, Collection<CommandFunction<T>>> pFunctions, ChainModifiers pChainModifiers)
-