Skip to content

Kit leftover items dropped on the ground are not splitted. #6579

Description

@BD9a

Type of bug

Error in console

/ess dump all output

N/A

Error log (if applicable)

https://pastes.dev/Mf4cs4X3Ls

Bug description

When drop-items-if-full is enabled, EssentialsX can drop oversized kit leftovers into the world.

Kit items are normalized before being added to the player inventory. If a kit contains multiple similar stackable items, EssentialsX may merge them into one internal ItemStack, for example two obsidian 64 entries become one OBSIDIAN x128.

If the player inventory is full, the leftover item is dropped with World#dropItemNaturally. For players without essentials.oversizedstacks, this leftover is not split before being dropped, so an invalid item entity such as OBSIDIAN x128 can be spawned.

On modern Minecraft versions, this can later fail during entity/chunk saving because item counts above the allowed save range are rejected.

Steps to reproduce

  1. Set this in Essentials config: drop-items-if-full: true
  2. Make sure the test player does not have: essentials.oversizedstacks
  3. Create a kit with duplicate stackable items:
kits:
  test:
    delay: 0
    items:
      - obsidian 64
      - obsidian 64
  1. Fill your inventory with anything.
  2. Redeem the kit, its items should drop on the ground.

Expected behaviour

Items should drop on the ground as a separate stacks.

Actual behaviour

Items drop as a single, big stack (of for example 128 items).

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug: unconfirmedPotential bugs that need replicating to verify.

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions