Just Outdoor Stuffs

Just Outdoor Stuffs

114k Downloads

[1.20.1-fabric-v1.0.2]Chair Block Can Be Pushed By Piston

wzsjc2020 opened this issue ยท 0 comments

commented

problem: when a player sitting on a sitEntity, and being pushed by a piston, the sit entity will also be pushed.
As a result, when player leaves the sit entity, it will remove a false entity potion from list.

override this method in ChairBlock to solve this problem
@OverRide
public PistonBehavior getPistonBehavior(BlockState state) {
return PistonBehavior.IGNORE;
}

at same time i suggest you to use world.getNonSpectatingEntities(WRITE YOUR ENTITY CLASS HERE, box) to detect if world position has a certain entity