PaperMC / Paper

The most widely used, high performance Minecraft server that aims to fix gameplay and mechanics inconsistencies
https://papermc.io/
Other
10.04k stars 2.34k forks source link

Lootable#setLootTable not modifying Entity loot tables #10189

Closed blaxout1213 closed 10 months ago

blaxout1213 commented 10 months ago

Expected behavior

Calling an Entity's setLootTable should... well, set the loot table.

Observed/Actual behavior

I am spawning an Entity that I immediately call setLootTable(LootTables.EMPTY.getLootTable()); on. Spigot docs say I should set to null, but this doesn't seem to have any impact on the drops of the entity, while setting to empty does.

On Spigot, this works as I expect, the entities spawned do not drop anything.

On Paper, with the same configuration (theyre launching from the same folder), this is not the case, they have standard vanilla drop tables. This happens when I set to null as well.

Steps/models to reproduce

  1. Spawn an entity
  2. Modify its loot table
  3. Kill it, and see standard drops

Plugin and Datapack List

SystemSecurity, WorldEdit, WorldGuard There are 2 data pack(s) enabled: [vanilla (built-in)], [file/bukkit (world)]

SystemSecurity is my plugin, who's development found this bug. My localhost test server is spigot, while my hosted test server for me + helpers is paper. Confirmed this happened on paper within my local setup as well, but is absent on spigot.

Paper version

This server is running Paper version git-Paper-398 (MC: 1.20.4) (Implementing API version 1.20.4-R0.1-SNAPSHOT) (Git: b700460) You are running the latest version

Other

No response

Machine-Maker commented 10 months ago

Interesting... yeah the issue is caused by LootTables.EMPTY#getLootTable actually returning null for empty when it shouldn't So doing LootTables.EMPTY is the same as null.