diff --git a/src/main/java/net/minestom/server/tag/TagHandlerImpl.java b/src/main/java/net/minestom/server/tag/TagHandlerImpl.java index cb1498327..dc80a01f9 100644 --- a/src/main/java/net/minestom/server/tag/TagHandlerImpl.java +++ b/src/main/java/net/minestom/server/tag/TagHandlerImpl.java @@ -100,8 +100,8 @@ final class TagHandlerImpl implements TagHandler { } private synchronized T updateTag0(@NotNull Tag tag, @NotNull UnaryOperator value, boolean returnPrevious) { + final Node node = traversePathWrite(root, tag, true); if (tag.isView()) { - Node node = traversePathWrite(root, tag, true); final T previousValue = tag.read(node.compound()); final T newValue = value.apply(previousValue); node.updateContent((NBTCompoundLike) tag.entry.write(newValue)); @@ -110,7 +110,6 @@ final class TagHandlerImpl implements TagHandler { } final int tagIndex = tag.index; - final Node node = traversePathWrite(root, tag, true); StaticIntMap> entries = node.entries; final Entry previousEntry = entries.get(tagIndex);