[SPIGOT-4874] LootTable error Created: 05/May/19  Updated: 21/May/19  Resolved: 06/May/19

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Nathan (antiPerson) Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: 1.14

Attachments: File loottabletest-1.0-SNAPSHOT.jar     File testplugin.jar    
Version: git-Spigot-1eece4f-84400e6 (MC: 1.14) (Implementing API version 1.14-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Whenever I try to do something regarding LootTables, this error is thrown in console:

https://hastebin.com/ruyesusuna.xml

Steps to reproduce (using included jar):

  1. Summon a pig
  2. Kill it. Then the error will appear.

Worked fine in 1.13.2.



 Comments   
Comment by md_5 [ 21/May/19 ]

Please open a new issue, the one described in this ticket was fixed

Comment by Jikoo [ 21/May/19 ]

I've been running into issues generating loot for entities as well: https://paste.md-5.net/aqulobucoz.cs
My proposed fix is to continue using LootContextParameterSets.EMPTY but remove the check for disallowed parameters.

Test plugin attached, source here.

// LootTableInfo.Builder
        public LootTableInfo build(LootContextParameterSet var0) {
            Set<LootContextParameter<?>> var2 = Sets.difference(var0.a(), this.b.keySet());
            if (!var2.isEmpty()) {
                throw new IllegalArgumentException("Missing required parameters: " + var2);
            } else {
                Random var3 = this.d;
                if (var3 == null) {
                    var3 = new Random();
                }

                return new LootTableInfo(var3, this.e, this.a, this.a.getMinecraftServer().getLootTableRegistry(), this.b, this.c);
            }
        }
Comment by md_5 [ 05/May/19 ]

Assuming the API can't be implemented as is, that would be the appropriate solution

Comment by Nathan (antiPerson) [ 05/May/19 ]

My proposed solution is to create a LootTableType enum which can be used to check and enforce the parameters given by plugins. Thoughts?

Comment by md_5 [ 05/May/19 ]

This seems like a good issue to have a go at fixing yourself.

Generated at Sat Dec 13 15:21:50 UTC 2025 using Jira 10.3.13#10030013-sha1:56dd970ae30ebfeda3a697d25be1f6388b68a422.