diff --git a/src/main/java/net/minestom/server/item/ItemMetaBuilder.java b/src/main/java/net/minestom/server/item/ItemMetaBuilder.java index 8f6eed47a..5c6a4c1cd 100644 --- a/src/main/java/net/minestom/server/item/ItemMetaBuilder.java +++ b/src/main/java/net/minestom/server/item/ItemMetaBuilder.java @@ -204,15 +204,13 @@ public abstract class ItemMetaBuilder implements TagWritable { protected abstract @NotNull Supplier<@NotNull ItemMetaBuilder> getSupplier(); - protected void mutateNbt(Consumer consumer) { + protected synchronized void mutateNbt(Consumer consumer) { if (built) { built = false; final var currentNbt = nbt; NBT_UPDATER.compareAndSet(this, currentNbt, currentNbt.deepClone()); } - synchronized (this) { - consumer.accept(nbt); - } + consumer.accept(nbt); } protected synchronized NBTCompound nbt() {