Say i wanted to check the value of a stringtag named haste and see if it's value was haste1, how would i check if its value is equal to haste1
This doesnt solve the thread, this just shows me how to add it/check if it has that tag, i want to check the data/value of that tag
That example does show you how to check the value of the tag, but anyway.. PHP: /** @var Item $item */$haste = $item->getNamedTag()["haste"];/** @var Tile|Entity $object */$haste = $object->namedtag["haste"]; You can also use PHP: /** @var CompoundTag $nbt */$haste = $nbt->haste;
shouldnt the second example solve it? if($test == 'instakill'){/*do stuff*/}elseif($test=='something else'){/*more stuff*/}
Use equal instead of identical operator if you want to use it that way. But the correct way would be to use PHP: /** @var Item $item */$item->getNamedTag()["haste"]//OR$item->getNamedTag()->haste->getValue()