Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

essentials.keepinv permission stops player loot table from dropping (breaking data packs), unlike /gamerule keepInventory true #5863

Open
GrantGryczan opened this issue Jul 6, 2024 · 0 comments
Labels
bug: unconfirmed Potential bugs that need replicating to verify.

Comments

@GrantGryczan
Copy link

GrantGryczan commented Jul 6, 2024

Type of bug

Compatibility issue, Other unexpected behaviour

/ess dump all output

I'm using EssentialsX 2.21.0-dev+102-fcf6e64 (latest as of writing) on CraftBukkit version 4254-Bukkit-bd4e8c3 (MC: 1.21) (Implementing API version 1.21-R0.1-SNAPSHOT).

/ess dump all currently outputs "Error while creating dump error code: 504." which sounds like an issue on the web server's end. If necessary, I can update this issue with a dump later after that issue is resolved.

Error log (if applicable)

No response

Bug description

Players with the essentials.keepinv permission should keep their inventory on death, but they should still drop their loot table. For example, using the Player Head Drops data pack from Vanilla Tweaks which makes a player killing another player drop their head, the head of a player with the essentials.keepinv permission will never drop.

Other data packs, such as Graves from Vanilla Tweaks, use player loot tables to save data from just before a player dies. It's otherwise impossible to do so (at least without saving the player's NBT data every tick, which would be just about the laggiest thing a data pack can do). A data pack using this method adds to the player loot table an item which copies data from the player onto it via an item modifier, so that the data is persisted and can be read after the player dies. But with this bug, any data packs that rely on this method of saving player data on death (such as items from their inventory or how much XP they had) won't find the loot table item for any players with the essentials.keepinv permission.

Steps to reproduce

  1. On a 1.21 server, install this minimal reproduction data pack to your world by copying it into the server's world > datapacks folder. This adds an unconditional player head to the player's loot table.
  2. Enter /minecraft:reload to load the data pack.
  3. Give your player the essentials.keepinv permission. (Or if testing without EssentialsX for comparison, enter /gamerule keepInventory true.)
  4. Enter /minecraft:kill.

Expected behaviour

Just like using /gamerule keepInventory true, dying with the essentials.keepinv permission should drop your loot table.

Actual behaviour

With EssentialsX, using the essentials.keepinv permission, dying does not drop your loot table.

Additional Information

It's important to emphasize that not only does this bugged behavior deviate from the vanilla gameplay functionality of keepInventory (e.g. players not dropping their heads when killed with a data pack like Player Head Drops), but it also causes incompatibilities with other data packs that rely on player loot tables to preserve player information on death. And again, there isn't really any efficient alternative that works as well as using a player loot table, so data packs have no workaround for this. Using Graves as an example again, this bug currently causes a big warning to show up in chat due to the loot table item not being detected every time a player with this permission dies.

@GrantGryczan GrantGryczan added the bug: unconfirmed Potential bugs that need replicating to verify. label Jul 6, 2024
@GrantGryczan GrantGryczan changed the title essentials.keepinv permission stops player loot table from dropping, unlike /gamerule keepInventory true (breaking data packs) essentials.keepinv permission stops player loot table from dropping (breaking data packs), unlike /gamerule keepInventory true Jul 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug: unconfirmed Potential bugs that need replicating to verify.
Projects
None yet
Development

No branches or pull requests

1 participant