Sponge icon indicating copy to clipboard operation
Sponge copied to clipboard

Cancelling a `InteractBlockEvent.Secondary` doesn't refresh count in inventory

Open carbotaniuman opened this issue 3 years ago • 0 comments

Affected Product(s)

SpongeForge, SpongeVanilla

Version

1.16.5-36.2.5-8.1.0-RC1164

Operating System

Windows

Java Version

OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_282-b08)

Plugins/Mods

None other than this plugin

Describe the bug

@Listener
public void test(InteractBlockEvent.Secondary event, @First ServerPlayer p) {
    event.setCancelled(true);
}

When a user tries to place some a block such as dirt with this listener active, the dirt will be prevented from placing, but the quantity of the item stack will drop by 1 as-if the place went through. The count can be updated by moving the stack from one slot or another, or simply collecting another block of dirt.

Link to logs

No response

carbotaniuman avatar Jul 25 '22 04:07 carbotaniuman