Package net.minecraft.server.command
Class LootCommand
java.lang.Object
net.minecraft.server.command.LootCommand
public class LootCommand extends Object
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfaceLootCommand.FeedbackMessage(package private) static interfaceLootCommand.SourceConstructor(package private) static interfaceLootCommand.Target -
Field Summary
Fields Modifier and Type Field Description private static com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeNO_HELD_ITEMS_EXCEPTIONprivate static com.mojang.brigadier.exceptions.DynamicCommandExceptionTypeNO_LOOT_TABLE_EXCEPTIONstatic com.mojang.brigadier.suggestion.SuggestionProvider<ServerCommandSource>SUGGESTION_PROVIDER -
Constructor Summary
Constructors Constructor Description LootCommand() -
Method Summary
Modifier and Type Method Description private static <T extends com.mojang.brigadier.builder.ArgumentBuilder<ServerCommandSource, T>>
TaddTargetArguments(T rootArgument, LootCommand.SourceConstructor sourceConstructor)private static intexecuteBlock(ServerCommandSource source, BlockPos targetPos, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)private static intexecuteFish(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, BlockPos pos, ItemStack stack, LootCommand.Target constructor)private static intexecuteGive(Collection<ServerPlayerEntity> players, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)private static intexecuteInsert(ServerCommandSource source, BlockPos targetPos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)private static intexecuteKill(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Entity entity, LootCommand.Target constructor)private static intexecuteLoot(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, LootCommand.Target constructor)private static intexecuteMine(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, BlockPos pos, ItemStack stack, LootCommand.Target constructor)private static intexecuteReplace(Collection<? extends Entity> targets, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)private static intexecuteSpawn(ServerCommandSource source, Vec3d pos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender)private static InventorygetBlockInventory(ServerCommandSource source, BlockPos pos)private static intgetFeedbackMessageSingle(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, LootContext lootContext, LootCommand.Target constructor)private static ItemStackgetHeldItem(ServerCommandSource source, EquipmentSlot slot)private static booleaninsert(Inventory inventory, ItemStack stack)private static booleanitemsMatch(ItemStack first, ItemStack second)static voidregister(com.mojang.brigadier.CommandDispatcher<ServerCommandSource> dispatcher)private static voidreplace(Entity entity, List<ItemStack> stacks, int slot, int stackCount, List<ItemStack> addedStacks)private static voidsendDroppedFeedback(ServerCommandSource source, List<ItemStack> stacks)private static voidsendDroppedFeedback(ServerCommandSource source, List<ItemStack> stacks, Identifier lootTable)
-
Field Details
-
SUGGESTION_PROVIDER
public static final com.mojang.brigadier.suggestion.SuggestionProvider<ServerCommandSource> SUGGESTION_PROVIDER -
NO_HELD_ITEMS_EXCEPTION
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType NO_HELD_ITEMS_EXCEPTION -
NO_LOOT_TABLE_EXCEPTION
private static final com.mojang.brigadier.exceptions.DynamicCommandExceptionType NO_LOOT_TABLE_EXCEPTION
-
-
Constructor Details
-
LootCommand
public LootCommand()
-
-
Method Details
-
register
public static void register(com.mojang.brigadier.CommandDispatcher<ServerCommandSource> dispatcher) -
addTargetArguments
private static <T extends com.mojang.brigadier.builder.ArgumentBuilder<ServerCommandSource, T>> T addTargetArguments(T rootArgument, LootCommand.SourceConstructor sourceConstructor) -
getBlockInventory
private static Inventory getBlockInventory(ServerCommandSource source, BlockPos pos) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
executeInsert
private static int executeInsert(ServerCommandSource source, BlockPos targetPos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
insert
-
executeBlock
private static int executeBlock(ServerCommandSource source, BlockPos targetPos, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
itemsMatch
-
executeGive
private static int executeGive(Collection<ServerPlayerEntity> players, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
replace
-
executeReplace
private static int executeReplace(Collection<? extends Entity> targets, int slot, int stackCount, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
executeSpawn
private static int executeSpawn(ServerCommandSource source, Vec3d pos, List<ItemStack> stacks, LootCommand.FeedbackMessage messageSender) -
sendDroppedFeedback
-
sendDroppedFeedback
private static void sendDroppedFeedback(ServerCommandSource source, List<ItemStack> stacks, Identifier lootTable) -
getHeldItem
private static ItemStack getHeldItem(ServerCommandSource source, EquipmentSlot slot) throws com.mojang.brigadier.exceptions.CommandSyntaxException- Throws:
com.mojang.brigadier.exceptions.CommandSyntaxException
-
executeMine
private static int executeMine(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, BlockPos pos, ItemStack stack, LootCommand.Target constructor) -
executeKill
private static int executeKill(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Entity entity, LootCommand.Target constructor) -
executeLoot
private static int executeLoot(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, LootCommand.Target constructor) -
executeFish
private static int executeFish(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, BlockPos pos, ItemStack stack, LootCommand.Target constructor) -
getFeedbackMessageSingle
private static int getFeedbackMessageSingle(com.mojang.brigadier.context.CommandContext<ServerCommandSource> context, Identifier lootTable, LootContext lootContext, LootCommand.Target constructor)
-