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.DynamicCommandExceptionTypestatic final com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static <T extends com.mojang.brigadier.builder.ArgumentBuilder<CommandSourceStack,T>>
TaddTargets(T builder, LootCommand.TailProvider tailProvider) private static intblockDistribute(CommandSourceStack source, BlockPos pos, List<ItemStack> items, LootCommand.Callback callback) private static intblockReplace(CommandSourceStack source, BlockPos pos, int slot, int numSlots, List<ItemStack> items, LootCommand.Callback callback) private static voidcallback(CommandSourceStack source, List<ItemStack> items) private static voidcallback(CommandSourceStack source, List<ItemStack> items, ResourceKey<LootTable> lootTable) private static booleancanMergeItems(ItemStack first, ItemStack second) private static booleandistributeToContainer(Container container, ItemStack item) private static intdrop(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Holder<LootTable> lootTable, LootParams params, LootCommand.DropConsumer dropConsumer) private static intdropBlockLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, BlockPos pos, ItemStack tool, LootCommand.DropConsumer dropConsumer) private static intdropChestLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Holder<LootTable> lootTable, LootCommand.DropConsumer dropCOnsimer) private static intdropFishingLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Holder<LootTable> lootTable, BlockPos pos, ItemStack tool, LootCommand.DropConsumer dropConsumet) private static intdropInWorld(CommandSourceStack source, Vec3 pos, List<ItemStack> items, LootCommand.Callback callback) private static intdropKillLoot(com.mojang.brigadier.context.CommandContext<CommandSourceStack> context, Entity p_entity, LootCommand.DropConsumer dropConsumer) private static intentityReplace(Collection<? extends Entity> targets, int startSlot, int numSlots, List<ItemStack> items, LootCommand.Callback callback) private static ContainergetContainer(CommandSourceStack source, BlockPos pos) private static ItemStackgetSourceHandItem(CommandSourceStack source, EquipmentSlot slot) private static intplayerGive(Collection<ServerPlayer> targets, List<ItemStack> items, LootCommand.Callback callback) static voidregister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, CommandBuildContext context) private static voidsetSlots(Entity target, List<ItemStack> items, int startSlot, int numSlots, List<ItemStack> setItems)
-
Field Details
-
SUGGEST_LOOT_TABLE
public static final com.mojang.brigadier.suggestion.SuggestionProvider<CommandSourceStack> SUGGEST_LOOT_TABLE -
ERROR_NO_HELD_ITEMS
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_NO_HELD_ITEMS -
ERROR_NO_LOOT_TABLE
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType ERROR_NO_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 builder, LootCommand.TailProvider tailProvider) -
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> items, 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 slot, int numSlots, List<ItemStack> items, LootCommand.Callback callback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
canMergeItems
-
playerGive
private static int playerGive(Collection<ServerPlayer> targets, List<ItemStack> items, LootCommand.Callback callback) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
setSlots
-
entityReplace
private static int entityReplace(Collection<? extends Entity> targets, int startSlot, int numSlots, List<ItemStack> items, 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> items, 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> items, ResourceKey<LootTable> lootTable) -
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, ItemStack tool, LootCommand.DropConsumer dropConsumer) 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 p_entity, LootCommand.DropConsumer dropConsumer) 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 dropCOnsimer) 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, ItemStack tool, LootCommand.DropConsumer dropConsumet) 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 params, LootCommand.DropConsumer dropConsumer) throws com.mojang.brigadier.exceptions.CommandSyntaxException - Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-