Class LootCommand
java.lang.Object
net.minecraft.server.commands.LootCommand
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static interfaceprivate 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.DynamicCommandExceptionType -
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 intblockDistribute(CommandSourceStack source, BlockPos pos, List<ItemStack> drops, LootCommand.Callback callback) private static intblockReplace(CommandSourceStack source, BlockPos pos, int startSlot, int slotCount, List<ItemStack> drops, LootCommand.Callback callback) private static voidcallback(CommandSourceStack source, List<ItemStack> drops) private static voidcallback(CommandSourceStack source, List<ItemStack> drops, ResourceKey<LootTable> location) 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 intdropInWorld(CommandSourceStack source, Vec3 pos, List<ItemStack> drops, LootCommand.Callback callback) private static intdropKillLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Entity target, LootCommand.DropConsumer output) private static intentityReplace(Collection<? extends Entity> entities, int startSlot, int count, List<ItemStack> drops, LootCommand.Callback callback) private static ContainergetContainer(CommandSourceStack source, BlockPos pos) private static ItemStackgetSourceHandItem(CommandSourceStack source, EquipmentSlot slot) private static intplayerGive(Collection<ServerPlayer> players, List<ItemStack> drops, LootCommand.Callback callback) static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) private static voidsetSlots(Entity entity, List<ItemStack> itemsToSet, int startSlot, int count, List<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
-
-
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) -
getContainer
private static Container getContainer(CommandSourceStack source, BlockPos pos) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
blockDistribute
private static int blockDistribute(CommandSourceStack source, BlockPos pos, List<ItemStack> drops, LootCommand.Callback callback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
distributeToContainer
-
blockReplace
private static int blockReplace(CommandSourceStack source, BlockPos pos, int startSlot, int slotCount, List<ItemStack> drops, LootCommand.Callback callback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
canMergeItems
-
playerGive
private static int playerGive(Collection<ServerPlayer> players, List<ItemStack> drops, LootCommand.Callback callback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
setSlots
-
entityReplace
private static int entityReplace(Collection<? extends Entity> entities, int startSlot, int count, List<ItemStack> drops, LootCommand.Callback callback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
dropInWorld
private static int dropInWorld(CommandSourceStack source, Vec3 pos, List<ItemStack> drops, LootCommand.Callback callback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
callback
-
callback
private static void callback(CommandSourceStack source, List<ItemStack> drops, ResourceKey<LootTable> location) -
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
-