diff --git a/src/network/mcpe/NetworkSession.php b/src/network/mcpe/NetworkSession.php index 6f4380d4a..5c4075eac 100644 --- a/src/network/mcpe/NetworkSession.php +++ b/src/network/mcpe/NetworkSession.php @@ -686,9 +686,6 @@ class NetworkSession{ $this->sendDataPacket(UpdateAttributesPacket::create($entity->getId(), array_map(function(Attribute $attr) : NetworkAttribute{ return new NetworkAttribute($attr->getId(), $attr->getMinValue(), $attr->getMaxValue(), $attr->getValue(), $attr->getDefaultValue()); }, $entries))); - foreach($entries as $entry){ - $entry->markSynchronized(); - } } } diff --git a/src/player/Player.php b/src/player/Player.php index 18c5aac29..1d4f8169a 100644 --- a/src/player/Player.php +++ b/src/player/Player.php @@ -1292,6 +1292,9 @@ class Player extends Human implements CommandSender, ChunkLoader, ChunkListener, //TODO: move this to network session ticking (this is specifically related to net sync) $this->networkSession->syncAttributes($this); + foreach($this->attributeMap->getAll() as $attribute){ + $attribute->markSynchronized(); + } if(!$this->isAlive() and $this->spawned){ $this->onDeathUpdate($tickDiff);