From bd9784b4a5ccc3be9ea6c0d2721c7883df2d2c48 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 6 Nov 2020 10:31:30 +0100 Subject: [PATCH] Test sneaking --- src/de/steamwar/spectatesystem/elements/REntity.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/spectatesystem/elements/REntity.java b/src/de/steamwar/spectatesystem/elements/REntity.java index 8cf7765..39f7e36 100644 --- a/src/de/steamwar/spectatesystem/elements/REntity.java +++ b/src/de/steamwar/spectatesystem/elements/REntity.java @@ -101,7 +101,8 @@ public abstract class REntity { public void sneak(boolean sneaking) { entity.setSneaking(sneaking); - entity.getDataWatcher().register(new DataWatcherObject<>(0, DataWatcherRegistry.a), (byte)0x02); + entity.getDataWatcher().set(new DataWatcherObject<>(0, DataWatcherRegistry.a), (byte)0x02); + entity.getDataWatcher().markDirty(new DataWatcherObject<>(0, DataWatcherRegistry.a)); PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.getId(), entity.getDataWatcher(), false); for(Player player : Bukkit.getOnlinePlayers()){