diff --git a/src/nbt/tags/TAG_Compound.php b/src/nbt/tags/TAG_Compound.php index 9ef215968..3f54e5c10 100644 --- a/src/nbt/tags/TAG_Compound.php +++ b/src/nbt/tags/TAG_Compound.php @@ -31,7 +31,11 @@ class NBTTag_Compound extends NamedNBTTag{ public function __set($name, $value){ if(isset($this->value[$name])){ - $this->value[$name]->setValue($value); + if($value instanceof NamedNBTTag and $value->getName() !== "" and $value->getName() !== false){ + $this->value[$value->getName()]->setValue($value); + }else{ + $this->value[$name]->setValue($value); + } } }