-
Bug
-
Resolution: Invalid
-
None
-
24w10a
-
None
-
Community Consensus
-
(Unassigned)
Steps to reproduce:
Create a setup like in fig1.png
Run /tick freeze
Break the redstone block followed by the piston head (the order is important)
Place a piston against the oak planks so it faces downwards
Compare your setup to fig2.png
Run /tick unfreeze
Compare your setup to fig3.png
Observed behavior:
The block below the piston breaks but doesn't drop anything
Expected behavior:
The block below the piston breaks and drops a block according to the rules of /setblock <coordinates> air destroy
Suggested fix:
On a piston retraction if the block in front of the base is a minecraft:pison_head do nothing and continue to retraction logic,
Otherwise, break the block in front of the base rather than setting it to air
Java-like pseudocode:
public class PistonBase { public void onRetract() { // If the block is a piston head, do nothing if(this.getBlockInFront() instanceof PistonHead) this.getBlockInFront().getLocation().getBlock(AIR); // If the block is not a piston head, break it else this.getBlockInFront().getLocation().destroy(); // The rest of the logic in this function } }