Class ItemCommands
java.lang.Object
net.minecraft.server.commands.item.ItemCommands
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final List<ArgProvider.Factory<ItemAccessor<?>>> private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionTypestatic final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.SimpleCommandExceptionTypestatic final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypestatic final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionTypestatic final List<ArgProvider<ItemAccessor<?>>> static final List<ArgProvider<ItemAccessor<?>>> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static UnaryOperator<ItemStack> applyModifier(CommandSourceStack source, LootItemFunction modifier) static ItemProviderfillItemProvider(Collection<ItemStack> items) private static Collection<ItemStack> getItems(CommandSourceStack source, ItemAccessor<?> accessor, SlotSourceArgument.Result slotSource, @Nullable Holder<LootItemFunction> modifier) (package private) static SlotCollectiongetSlotsFromProvider(CommandSourceStack source, SlotProvider container, SlotSource slotSource) private static <Target> intmodifyItems(CommandSourceStack source, ItemAccessor<Target> accessor, SlotSourceArgument.Result slotSource, Holder<LootItemFunction> modifier) static ItemProvideroverrideItemProvider(Collection<ItemStack> items) static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) static ItemProviderreplaceItemProvider(Collection<ItemStack> items) private static intsetItem(CommandSourceStack source, ItemAccessor<?> accessor, SlotSourceArgument.Result slotSource, ItemCommands.ItemDistributor distributor, ItemStack item) private static intsetItems(CommandSourceStack source, ItemAccessor<?> accessor, SlotSourceArgument.Result slotSource, ItemCommands.ItemDistributor distributor, Collection<ItemStack> items) private static <Target> intsetItems(CommandSourceStack source, ItemAccessor<Target> accessor, SlotSourceArgument.Result slotSource, ItemProvider items, @Nullable ItemStack knownItem) private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> wrapSetItems(CommandBuildContext context, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> builder, ArgProvider<ItemAccessor<?>> targetProvider, ItemCommands.ItemDistributor distributor)
-
Field Details
-
ERROR_TARGET_NOT_A_CONTAINER
public static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType ERROR_TARGET_NOT_A_CONTAINER -
ERROR_SOURCE_NOT_A_CONTAINER
public static final com.mojang.brigadier.exceptions.Dynamic3CommandExceptionType ERROR_SOURCE_NOT_A_CONTAINER -
ERROR_TARGET_INAPPLICABLE_SLOT
public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_TARGET_INAPPLICABLE_SLOT -
ERROR_TARGET_INAPPLICABLE_UNNAMED_SLOT
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_TARGET_INAPPLICABLE_UNNAMED_SLOT -
ERROR_SOURCE_INAPPLICABLE_SLOT
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_SOURCE_INAPPLICABLE_SLOT -
ERROR_SOURCE_INAPPLICABLE_UNNAMED_SLOT
private static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_SOURCE_INAPPLICABLE_UNNAMED_SLOT -
ERROR_TARGET_NO_CHANGES
public static final com.mojang.brigadier.exceptions.SimpleCommandExceptionType ERROR_TARGET_NO_CHANGES -
ERROR_TARGET_NO_CHANGES_KNOWN_ITEM
public static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_TARGET_NO_CHANGES_KNOWN_ITEM -
ALL_PROVIDERS
-
TARGET_PROVIDERS
-
SOURCE_PROVIDERS
-
-
Constructor Details
-
ItemCommands
public ItemCommands()
-
-
Method Details
-
register
public static void register(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) -
wrapSetItems
private static com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> wrapSetItems(CommandBuildContext context, com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, ?> builder, ArgProvider<ItemAccessor<?>> targetProvider, ItemCommands.ItemDistributor distributor) -
replaceItemProvider
-
fillItemProvider
-
overrideItemProvider
-
setItems
private static <Target> int setItems(CommandSourceStack source, ItemAccessor<Target> accessor, SlotSourceArgument.Result slotSource, ItemProvider items, @Nullable ItemStack knownItem) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
setItems
private static int setItems(CommandSourceStack source, ItemAccessor<?> accessor, SlotSourceArgument.Result slotSource, ItemCommands.ItemDistributor distributor, Collection<ItemStack> items) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
setItem
private static int setItem(CommandSourceStack source, ItemAccessor<?> accessor, SlotSourceArgument.Result slotSource, ItemCommands.ItemDistributor distributor, ItemStack item) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
modifyItems
private static <Target> int modifyItems(CommandSourceStack source, ItemAccessor<Target> accessor, SlotSourceArgument.Result slotSource, Holder<LootItemFunction> modifier) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
getItems
private static Collection<ItemStack> getItems(CommandSourceStack source, ItemAccessor<?> accessor, SlotSourceArgument.Result slotSource, @Nullable Holder<LootItemFunction> modifier) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
applyModifier
private static UnaryOperator<ItemStack> applyModifier(CommandSourceStack source, LootItemFunction modifier) -
getSlotsFromProvider
static SlotCollection getSlotsFromProvider(CommandSourceStack source, SlotProvider container, SlotSource slotSource)
-