Spoiler PHP: function onArmorChange(EntityArmorChange $e){$item = $e->getItem()->getId();if($item == Item){$e->setCancelled();
PHP: public function onArmorCange(EntityArmorChangeEvent $e){$entity = $e->getEntity(); //Entity$item = $e->getItem()->getId(); //ItemIdif($entity instanceof Player){ //Check when entity is Player$e->setCancelled(); //Cancel event$entity->getInventory()->setBoots( Boots ); //Set boots$entity->getInventory()->sendArmorContents($entity); //send Armor contents
PHP: public function onArmor(EntityArmorChangeEvent $ev){ $itemid = $ev->getNewItem()->getId(); $boots = array_flip([301,305,309,313,317]); $event->setCancelled(isset($boots[$itemid]));}
Guessing you want to cancel it in a certain world Code: public function onArmor(EntityArmorChangeEvent $event){ if( $player->getLevel()->getFolderName() == "Lobby" ) { $event->setCancelled( true ); } }