Add Sneaking API for Entities

This commit is contained in:
dawon 2022-10-19 23:31:53 +02:00
parent 981cf9de7a
commit f64904e777

View File

@ -870,6 +870,18 @@ public abstract class CraftEntity implements org.bukkit.entity.Entity {
return Pose.values()[this.getHandle().getPose().ordinal()];
}
// Paper start
@Override
public void setSneaking(boolean sneak) {
this.getHandle().setShiftKeyDown(sneak);
}
@Override
public boolean isSneaking() {
return this.getHandle().isShiftKeyDown();
}
// Paper end
@Override
public SpawnCategory getSpawnCategory() {
return CraftSpawnCategory.toBukkit(this.getHandle().getType().getCategory());