Class ItemCommands
java.lang.Object
net.minecraft.server.commands.ItemCommands
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final DynamicCommandExceptionType(package private) static final Dynamic3CommandExceptionType(package private) static final DynamicCommandExceptionTypeprivate static final DynamicCommandExceptionTypeprivate static final Dynamic2CommandExceptionType(package private) static final Dynamic3CommandExceptionType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static ItemStackapplyModifier(CommandSourceStack source, Holder<LootItemFunction> modifier, ItemStack item) private static intblockToBlock(CommandSourceStack source, BlockPos sourcePos, int sourceSlot, BlockPos targetPos, int targetSlot) private static intblockToBlock(CommandSourceStack source, BlockPos sourcePos, int sourceSlot, BlockPos targetPos, int targetSlot, Holder<LootItemFunction> modifier) private static intblockToEntities(CommandSourceStack source, BlockPos sourcePos, int sourceSlot, Collection<? extends Entity> targetEntities, int targetSlot) private static intblockToEntities(CommandSourceStack source, BlockPos sourcePos, int sourceSlot, Collection<? extends Entity> targetEntities, int targetSlot, Holder<LootItemFunction> modifier) private static intentityToBlock(CommandSourceStack source, Entity sourceEntity, int sourceSlot, BlockPos targetPos, int targetSlot) private static intentityToBlock(CommandSourceStack source, Entity sourceEntity, int sourceSlot, BlockPos targetPos, int targetSlot, Holder<LootItemFunction> modifier) private static intentityToEntities(CommandSourceStack source, Entity sourceEntity, int sourceSlot, Collection<? extends Entity> targetEntities, int targetSlot) private static intentityToEntities(CommandSourceStack source, Entity sourceEntity, int sourceSlot, Collection<? extends Entity> targetEntities, int targetSlot, Holder<LootItemFunction> modifier) private static ItemStackgetBlockItem(CommandSourceStack source, BlockPos pos, int slot) (package private) static ContainergetContainer(CommandSourceStack source, BlockPos pos, Dynamic3CommandExceptionType exceptionType) private static ItemStackgetItemInSlot(SlotProvider slotProvider, int slot) private static intmodifyBlockItem(CommandSourceStack source, BlockPos pos, int slot, Holder<LootItemFunction> modifier) private static intmodifyEntityItem(CommandSourceStack source, Collection<? extends Entity> entities, int slot, Holder<LootItemFunction> modifier) static voidregister(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) private static intsetBlockItem(CommandSourceStack source, BlockPos pos, int slot, ItemStack itemStack) private static intsetEntityItem(CommandSourceStack source, Collection<? extends Entity> entities, int slot, ItemStack itemStack)
-
Field Details
-
ERROR_TARGET_NOT_A_CONTAINER
-
ERROR_SOURCE_NOT_A_CONTAINER
-
ERROR_TARGET_INAPPLICABLE_SLOT
-
ERROR_SOURCE_INAPPLICABLE_SLOT
-
ERROR_TARGET_NO_CHANGES
-
ERROR_TARGET_NO_CHANGES_KNOWN_ITEM
-
-
Constructor Details
-
ItemCommands
public ItemCommands()
-
-
Method Details
-
register
public static void register(CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) -
modifyBlockItem
private static int modifyBlockItem(CommandSourceStack source, BlockPos pos, int slot, Holder<LootItemFunction> modifier) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
modifyEntityItem
private static int modifyEntityItem(CommandSourceStack source, Collection<? extends Entity> entities, int slot, Holder<LootItemFunction> modifier) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
setBlockItem
private static int setBlockItem(CommandSourceStack source, BlockPos pos, int slot, ItemStack itemStack) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
getContainer
static Container getContainer(CommandSourceStack source, BlockPos pos, Dynamic3CommandExceptionType exceptionType) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
setEntityItem
private static int setEntityItem(CommandSourceStack source, Collection<? extends Entity> entities, int slot, ItemStack itemStack) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
blockToEntities
private static int blockToEntities(CommandSourceStack source, BlockPos sourcePos, int sourceSlot, Collection<? extends Entity> targetEntities, int targetSlot) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
blockToEntities
private static int blockToEntities(CommandSourceStack source, BlockPos sourcePos, int sourceSlot, Collection<? extends Entity> targetEntities, int targetSlot, Holder<LootItemFunction> modifier) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
blockToBlock
private static int blockToBlock(CommandSourceStack source, BlockPos sourcePos, int sourceSlot, BlockPos targetPos, int targetSlot) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
blockToBlock
private static int blockToBlock(CommandSourceStack source, BlockPos sourcePos, int sourceSlot, BlockPos targetPos, int targetSlot, Holder<LootItemFunction> modifier) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
entityToBlock
private static int entityToBlock(CommandSourceStack source, Entity sourceEntity, int sourceSlot, BlockPos targetPos, int targetSlot) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
entityToBlock
private static int entityToBlock(CommandSourceStack source, Entity sourceEntity, int sourceSlot, BlockPos targetPos, int targetSlot, Holder<LootItemFunction> modifier) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
entityToEntities
private static int entityToEntities(CommandSourceStack source, Entity sourceEntity, int sourceSlot, Collection<? extends Entity> targetEntities, int targetSlot) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
entityToEntities
private static int entityToEntities(CommandSourceStack source, Entity sourceEntity, int sourceSlot, Collection<? extends Entity> targetEntities, int targetSlot, Holder<LootItemFunction> modifier) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
applyModifier
private static ItemStack applyModifier(CommandSourceStack source, Holder<LootItemFunction> modifier, ItemStack item) -
getItemInSlot
private static ItemStack getItemInSlot(SlotProvider slotProvider, int slot) throws CommandSyntaxException - Throws:
CommandSyntaxException
-
getBlockItem
private static ItemStack getBlockItem(CommandSourceStack source, BlockPos pos, int slot) throws CommandSyntaxException - Throws:
CommandSyntaxException
-