From f64904e7770332a9b4d86260de2f44db6424f64b Mon Sep 17 00:00:00 2001 From: dawon <dawon@dawon.eu> Date: Wed, 19 Oct 2022 23:31:53 +0200 Subject: [PATCH] Add Sneaking API for Entities --- .../org/bukkit/craftbukkit/entity/CraftEntity.java | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java index 1edccd83ec..0e65361b6a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java +++ b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftEntity.java @@ -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());