Uploaded image for project: 'Spigot'
  1. Spigot
  2. SPIGOT-6199

LootContext#build() still non-functional

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • None
    • None
    • CraftBukkit version git-Spigot-57bbdd8-55a78ff (MC: 1.16.3) (Implementing API version 1.16.3-R0.1-SNAPSHOT)
    • Yes

      After testing the resolved issue SPIGOT-6130 (https://hub.spigotmc.org/jira/projects/SPIGOT/issues/SPIGOT-6130?filter=doneissues ), I can confirm that this fix is not present in the latest versions of Spigot 1.16.3

       

      [19:40:57] [Server thread/INFO]: Novalescent issued server command: /questtrigger -747563197
      [19:40:57] [Server thread/WARN]: java.lang.IllegalArgumentException: Missing required parameters: [<parameter minecraft:tool>, <parameter minecraft:killer_entity>, <parameter minecraft:this_entity>, <parameter minecraft:last_damage_player>, <parameter minecraft:direct_killer_entity>, <parameter minecraft:explosion_radius>, <parameter minecraft:block_entity>, <parameter minecraft:block_state>, <parameter minecraft:damage_source>]
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.LootTableInfo$Builder.build(SourceFile:208)
      [19:40:57] [Server thread/WARN]:        at org.bukkit.craftbukkit.v1_16_R2.CraftLootTable.convertContext(CraftLootTable.java:115)
      [19:40:57] [Server thread/WARN]:        at org.bukkit.craftbukkit.v1_16_R2.CraftLootTable.populateLoot(CraftLootTable.java:44)
      [19:40:57] [Server thread/WARN]:        at com.playmonumenta.scriptedquests.utils.InventoryUtils.getLootTableContents(InventoryUtils.java:88)
      [19:40:57] [Server thread/WARN]:        at com.playmonumenta.scriptedquests.quests.components.actions.ActionGiveReward$RewardMenu.openMenu(ActionGiveReward.java:65)
      [19:40:57] [Server thread/WARN]:        at com.playmonumenta.scriptedquests.quests.components.actions.ActionGiveReward.doAction(ActionGiveReward.java:339)
      [19:40:57] [Server thread/WARN]:        at com.playmonumenta.scriptedquests.quests.components.QuestActions.doActions(QuestActions.java:122)
      [19:40:57] [Server thread/WARN]:        at com.playmonumenta.scriptedquests.quests.components.actions.dialog.DialogClickableTextEntry$PlayerClickableTextEntry.doActionsIfConditionsMatch(DialogClickableTextEntry.java:48)
      [19:40:57] [Server thread/WARN]:        at com.playmonumenta.scriptedquests.commands.QuestTrigger.onCommand(QuestTrigger.java:71)
      [19:40:57] [Server thread/WARN]:        at org.bukkit.command.PluginCommand.execute(PluginCommand.java:45)
      [19:40:57] [Server thread/WARN]:        at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149)
      [19:40:57] [Server thread/WARN]:        at org.bukkit.craftbukkit.v1_16_R2.CraftServer.dispatchCommand(CraftServer.java:758)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.PlayerConnection.handleCommand(PlayerConnection.java:1697)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.PlayerConnection.a(PlayerConnection.java:1540)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.PacketPlayInChat.a(PacketPlayInChat.java:47)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.PacketPlayInChat.a(PacketPlayInChat.java:1)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:19)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.TickTask.run(SourceFile:18)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeTask(SourceFile:144)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.IAsyncTaskHandlerReentrant.executeTask(SourceFile:23)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.executeNext(SourceFile:118)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.ba(MinecraftServer.java:941)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.executeNext(MinecraftServer.java:934)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.IAsyncTaskHandler.awaitTasks(SourceFile:127)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.sleepForTick(MinecraftServer.java:918)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.w(MinecraftServer.java:850)
      [19:40:57] [Server thread/WARN]:        at net.minecraft.server.v1_16_R2.MinecraftServer.lambda$0(MinecraftServer.java:164)
      [19:40:57] [Server thread/WARN]:        at java.lang.Thread.run(Unknown Source)
      >version
      [19:41:15] [Server thread/INFO]: This server is running CraftBukkit version git-Spigot-57bbdd8-55a78ff (MC: 1.16.3) (Implementing API version 1.16.3-R0.1-SNAPSHOT)
      [19:41:15] [Server thread/INFO]: You are running the latest version
      

       

      To reproduce:

      1. Create a Minecraft Datapack with a loot table. You can generate a loot table here: https://amaury.carrade.eu/minecraft/loot_tables
      2. Get the path of the loot table in the datapack, and use the following code to attempt to build the LootTable by inputting the path in the namespace variable
      Player player;
      
      String namespace = "datapack:loot_table/goes/here";
      String[] split = namespace.split(":");
      LootTable table = Bukkit.getLootTable(new NamespacedKey(split[0], split[1]));
      Collection<ItemStack> items = table.populateLoot(new Random(), new LootContext.Builder(player.getLocation()).build());
      1. If successful, the last line should error out, unable to build the loot context.

      When able to, please take another look into this ASAP. Me and my team desperately need a fix for this, as we are unable to update versions without fear of our loot tables breaking because of it.

            Unassigned Unassigned
            Novalescent Novalescent
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: