PHP: if($event->getBlock()->getID() == Item::SIGN_POST || $event->getBlock()->getID() == Block::SIGN_POST || $event->getBlock()->getID() == Block::WALL_SIGN){$sign = $event->getPlayer()->getLevel()->getTile($event->getBlock());if($sign instanceof Sign){//blah..}} Can I do this? and is Item::SIGN_POST a must?
Nope. Checking Item::SIGN_POST will make it wrong. Item::SIGN_POST may be a registered ID in Block Class, causing your IF statement dont work the way you wanted
PHP: $block = $event->getBlock()if(in_array($block->getId(), [Block::SIGN_POST, Block::WALL_SIGN])){$sign = $event->getPlayer()->getLevel()->getTile($block);if($sign instanceof Sign){//blah..}} Actually, you can do this too
IDs is not an array, but the way @SuperMaXAleX used is to declare 2 IDs (SIGN_POST and WALL_SIGN) together as an array. However, his way is not recommended. Yep. But, using IF statement directly is better than using in_array() in this case.