Skip to content

Inventory desync & block update happening when canceling lily pad in BlockPlaceEvent #9504

@AnttiMK

Description

@AnttiMK

Expected behavior

The lily pad item to remain in my inventory (without ghosting) & block updates to not happen when canceling the placement of a lily pad on water

Observed/Actual behavior

When a lily pad is placed on water and the BlockPlaceEvent is canceled, the item ghosts out of the player's inventory and a block update happens.
https://github.com/PaperMC/Paper/assets/13612979/78b1558e-c8f5-4d33-bdf3-5e8f53f74295

Steps/models to reproduce

  1. Install test plugin
  2. Create a floating body of water
  3. Place a lily pad on the water, observe item ghosted out of inventory & block update happened, causing water to flow
  4. Place a block on top of the water, no block update happened nor did the item go invisible

Plugin and Datapack List

WorldEdit + test plugin:

@EventHandler(ignoreCancelled = true)
public void onBlockPlace(BlockPlaceEvent event) {
    if (event.getBlock().getType().equals(Material.LILY_PAD)) {
        event.getPlayer().sendPlainMessage("Lilypad placed and canceled");
        event.setCancelled(true);
    }
    if (event.getBlock().getType().equals(Material.STONE)) {
        event.getPlayer().sendPlainMessage("Stone placed and canceled");
        event.setCancelled(true);
    }
}

Paper version

This server is running Paper version git-Paper-83 (MC: 1.20.1) (Implementing API version 1.20.1-R0.1-SNAPSHOT) (Git: c793bd9)
You are running the latest version

Other

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    status: acceptedDisputed bug is accepted as valid or Feature accepted as desired to be added.type: bugSomething doesn't work as it was intended to.version: 1.20.1Game version 1.20.1

    Type

    Projects

    Status

    ✅ Accepted

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions