I'm trying to make it so when someone where's a helmet they can climb up walls but my code doesn't seem to work PHP: public function onClimb(EntityMotionEvent $event){ $player = $event->getPlayer(); $helmetid = $player->getInventory()->getHelmet()->getId(); $helmetd = $player->getInventory()->getHelmet()->getDamage(); if($helmetid === 397){ if($helmetd === 1){ $blocks = $player->getLevel()->getBlock($player)->getHorizontalSides(); $nonair = 0; foreach ($blocks as $block){ if($block->getId() !== Block::AIR && $block->isSolid()){ $nonair++; } } if($nonair > 0){ if(!$player->getGenericFlag(Entity::DATA_FLAG_WALLCLIMBING)){ $player->setGenericFlag(Entity::DATA_FLAG_WALLCLIMBING, true); } $player->resetFallDistance(); }else{ if($player->getGenericFlag(Entity::DATA_FLAG_WALLCLIMBING)){ $player->setGenericFlag(Entity::DATA_FLAG_WALLCLIMBING, false); } }} }else{ if($player->getGenericFlag(Entity::DATA_FLAG_WALLCLIMBING)){ $player->setGenericFlag(Entity::DATA_FLAG_WALLCLIMBING, false); } }