Package net.minecraft.server.commands
Class LootCommand
java.lang.Object
net.minecraft.server.commands.LootCommand
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static interface(package private) static interface(package private) static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeprivate static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T extends com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack,T>>
TaddTargets(T pBuilder, LootCommand.TailProvider pTailProvider) private static intblockDistribute(CommandSourceStack pSource, BlockPos pPos, List<ItemStack> pItems, LootCommand.Callback pCallback) private static intblockReplace(CommandSourceStack pSource, BlockPos pPos, int pSlot, int pNumSlots, List<ItemStack> pItems, LootCommand.Callback pCallback) private static voidcallback(CommandSourceStack pSource, List<ItemStack> pItems) private static voidcallback(CommandSourceStack pSource, List<ItemStack> pItems, ResourceKey<LootTable> pLootTable) private static booleancanMergeItems(ItemStack pFirst, ItemStack pSecond) private static booleandistributeToContainer(Container pContainer, ItemStack pItem) private static intdrop(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, Holder<LootTable> pLootTable, LootParams pParams, LootCommand.DropConsumer pDropConsumer) private static intdropBlockLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, BlockPos pPos, ItemStack pTool, LootCommand.DropConsumer pDropConsumer) private static intdropChestLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, Holder<LootTable> pLootTable, LootCommand.DropConsumer pDropConsumer) private static intdropFishingLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, Holder<LootTable> pLootTable, BlockPos pPos, ItemStack pTool, LootCommand.DropConsumer pDropConsumer) private static intdropInWorld(CommandSourceStack pSource, Vec3 pPos, List<ItemStack> pItems, LootCommand.Callback pCallback) private static intdropKillLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, Entity pEntity, LootCommand.DropConsumer pDropConsumer) private static intentityReplace(Collection<? extends Entity> pTargets, int pStartSlot, int pNumSlots, List<ItemStack> pItems, LootCommand.Callback pCallback) private static ContainergetContainer(CommandSourceStack pSource, BlockPos pPos) private static ItemStackgetSourceHandItem(CommandSourceStack pSource, EquipmentSlot pSlot) private static intplayerGive(Collection<ServerPlayer> pTargets, List<ItemStack> pItems, LootCommand.Callback pCallback) static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> pDispatcher, CommandBuildContext pContext) private static voidsetSlots(Entity pTarget, List<ItemStack> pItems, int pStartSlot, int pNumSlots, List<ItemStack> pSetItems)
-
Field Details
-
ERROR_NO_HELD_ITEMS
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_NO_HELD_ITEMS -
ERROR_NO_ENTITY_LOOT_TABLE
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_NO_ENTITY_LOOT_TABLE -
ERROR_NO_BLOCK_LOOT_TABLE
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_NO_BLOCK_LOOT_TABLE
-
-
Constructor Details
-
LootCommand
public LootCommand()
-
-
Method Details
-
register
public static void register(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> pDispatcher, CommandBuildContext pContext) -
addTargets
private static <T extends com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack,T>> T addTargets(T pBuilder, LootCommand.TailProvider pTailProvider) -
getContainer
private static Container getContainer(CommandSourceStack pSource, BlockPos pPos) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
blockDistribute
private static int blockDistribute(CommandSourceStack pSource, BlockPos pPos, List<ItemStack> pItems, LootCommand.Callback pCallback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
distributeToContainer
-
blockReplace
private static int blockReplace(CommandSourceStack pSource, BlockPos pPos, int pSlot, int pNumSlots, List<ItemStack> pItems, LootCommand.Callback pCallback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
canMergeItems
-
playerGive
private static int playerGive(Collection<ServerPlayer> pTargets, List<ItemStack> pItems, LootCommand.Callback pCallback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
setSlots
-
entityReplace
private static int entityReplace(Collection<? extends Entity> pTargets, int pStartSlot, int pNumSlots, List<ItemStack> pItems, LootCommand.Callback pCallback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropInWorld
private static int dropInWorld(CommandSourceStack pSource, Vec3 pPos, List<ItemStack> pItems, LootCommand.Callback pCallback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
callback
-
callback
private static void callback(CommandSourceStack pSource, List<ItemStack> pItems, ResourceKey<LootTable> pLootTable) -
getSourceHandItem
private static ItemStack getSourceHandItem(CommandSourceStack pSource, EquipmentSlot pSlot) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropBlockLoot
private static int dropBlockLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, BlockPos pPos, ItemStack pTool, LootCommand.DropConsumer pDropConsumer) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropKillLoot
private static int dropKillLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, Entity pEntity, LootCommand.DropConsumer pDropConsumer) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropChestLoot
private static int dropChestLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, Holder<LootTable> pLootTable, LootCommand.DropConsumer pDropConsumer) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropFishingLoot
private static int dropFishingLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, Holder<LootTable> pLootTable, BlockPos pPos, ItemStack pTool, LootCommand.DropConsumer pDropConsumer) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
drop
private static int drop(com.mojang.brigadier.context.CommandContext<CommandSourceStack> pContext, Holder<LootTable> pLootTable, LootParams pParams, LootCommand.DropConsumer pDropConsumer) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-