Class LootCommand
java.lang.Object
net.minecraft.server.commands.LootCommand
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceprivate 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.DynamicCommandExceptionTypeprivate static final CommandResponseTracker.MessagesWithArg<ItemStack, ResourceKey<LootTable>> private static final CommandResponseTracker.Messages<ItemStack> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T extends com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, T>>
TaddTargets(T root, LootCommand.TailProvider tail) private static voidblockDistribute(CommandSourceStack source, BlockPos pos, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) private static voidblockReplace(CommandSourceStack source, BlockPos pos, int startSlot, int slotCount, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) private static booleancanMergeItems(ItemStack a, ItemStack b) private static booleandistributeToContainer(Container container, ItemStack itemStack) private static intdrop(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Holder<LootTable> lootTable, LootParams lootParams, LootCommand.DropConsumer output) private static intdropBlockLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, BlockPos pos, ItemInstance tool, LootCommand.DropConsumer output) private static intdropChestLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Holder<LootTable> lootTable, LootCommand.DropConsumer output) private static intdropFishingLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Holder<LootTable> lootTable, BlockPos pos, ItemInstance tool, LootCommand.DropConsumer output) private static voiddropInWorld(CommandSourceStack source, Vec3 pos, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) private static intdropKillLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Entity target, LootCommand.DropConsumer output) private static voidentityReplace(Collection<? extends Entity> entities, int startSlot, int count, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) private static ItemStackgetSourceHandItem(CommandSourceStack source, EquipmentSlot slot) private static voidplayerGive(Collection<ServerPlayer> players, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) private static voidsetSlots(Entity entity, List<ItemStack> itemsToSet, int startSlot, int count, CommandResponseTracker<ItemStack> usedItems)
-
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 -
RESPONSE_WITHOUT_LOOT_TABLE
-
RESPONSE_WITH_LOOT_TABLE
private static final CommandResponseTracker.MessagesWithArg<ItemStack, ResourceKey<LootTable>> RESPONSE_WITH_LOOT_TABLE
-
-
Constructor Details
-
LootCommand
public LootCommand()
-
-
Method Details
-
register
public static void register(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) -
addTargets
private static <T extends com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack, T>> T addTargets(T root, LootCommand.TailProvider tail) -
blockDistribute
private static void blockDistribute(CommandSourceStack source, BlockPos pos, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
distributeToContainer
-
blockReplace
private static void blockReplace(CommandSourceStack source, BlockPos pos, int startSlot, int slotCount, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
canMergeItems
-
playerGive
private static void playerGive(Collection<ServerPlayer> players, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) -
setSlots
private static void setSlots(Entity entity, List<ItemStack> itemsToSet, int startSlot, int count, CommandResponseTracker<ItemStack> usedItems) -
entityReplace
private static void entityReplace(Collection<? extends Entity> entities, int startSlot, int count, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) -
dropInWorld
private static void dropInWorld(CommandSourceStack source, Vec3 pos, List<ItemStack> drops, CommandResponseTracker<ItemStack> usedItems) -
getSourceHandItem
private static ItemStack getSourceHandItem(CommandSourceStack source, EquipmentSlot slot) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropBlockLoot
private static int dropBlockLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, BlockPos pos, ItemInstance tool, LootCommand.DropConsumer output) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropKillLoot
private static int dropKillLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Entity target, LootCommand.DropConsumer output) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropChestLoot
private static int dropChestLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Holder<LootTable> lootTable, LootCommand.DropConsumer output) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropFishingLoot
private static int dropFishingLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Holder<LootTable> lootTable, BlockPos pos, ItemInstance tool, LootCommand.DropConsumer output) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
drop
private static int drop(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Holder<LootTable> lootTable, LootParams lootParams, LootCommand.DropConsumer output) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-