Ghost block when cancel a piston event

ChangeBlockEvent.Place will fire when piston is triggered. Cancel that event will generate a ghost block like video shown here. I was testing this on both vanilla and forge with MC version 1.10.2 and 1.11.2

I want know how to prevent it or how can I help for fix it.

You can listen and cancel ChangeBlockEvent.Pre so it’s cancelled before any specific block logic is called (which may be generating the ghost block).

Edit: Or if you’re not trying to cancel it at all, can you post your code and what you are trying to do?

1 Like

I will try this soon
But why when I listen to ChangeBlockEvent, there only Place and Post are fired?

There were some recent changes that tweak how the events work, use the latest version of whichever Sponge you’re on and try again - it should fire.

Produce ghost block by those code:
public void onChangeBlockEvent(ChangeBlockEvent.Place event) {
event.setCancelled(true);
}

Pre are work
Thanks for quickly help!

public void onChangeBlockEvent(ChangeBlockEvent event) {
System.out.println(event.toString());
}
Only get Place and Post

Version below are tested:
spongevanilla-1.10.2-5.1.0-BETA-370
spongevanilla-1.11.2-6.0.0-BETA-206

But when actually listen to Pre, it works.