From 3939a417d331df4f0462cdc644e8935ea2abd69c Mon Sep 17 00:00:00 2001 From: Lixfel Date: Fri, 6 Nov 2020 12:18:56 +0100 Subject: [PATCH] Test sneaking --- src/de/steamwar/spectatesystem/elements/REntity.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/de/steamwar/spectatesystem/elements/REntity.java b/src/de/steamwar/spectatesystem/elements/REntity.java index 58bf241..93edbcf 100644 --- a/src/de/steamwar/spectatesystem/elements/REntity.java +++ b/src/de/steamwar/spectatesystem/elements/REntity.java @@ -104,7 +104,9 @@ public abstract class REntity { DataWatcher dataWatcher = new DataWatcher(entity); System.out.println("Let " + entity.getName() + " sneak " + sneaking); - dataWatcher.register(new DataWatcherObject<>(0, DataWatcherRegistry.a), sneaking ? (byte)0x02 : (byte)0x40); + DataWatcherObject dwo = new DataWatcherObject<>(0, DataWatcherRegistry.a); + dataWatcher.register(dwo, sneaking ? (byte)0x02 : (byte)0x40); + dataWatcher.markDirty(dwo); PacketPlayOutEntityMetadata packet = new PacketPlayOutEntityMetadata(entity.getId(), dataWatcher, true); for(Player player : Bukkit.getOnlinePlayers()){