How would I make it so that I could make a gold block popup in the inventory like when you interact with snowballs and xpbottles?
$player->getInventory()->getItemInHand()->setSize(5); sleep(1); $player->getInventory()->getItemInHand()->setSize(1);
The title doesn't match your description but here's some code I provided for you PHP: public function onInteract(PlayerInteractEvent $event){ //use the class Item and PlayerInteractEvent$player = $event->getPlayer();$hand = $player->getInventory()->getItemInHand();if($hand->getID() === 384){ // 384 is experience bottle $player->getInventory()->addItem(Item::get(Item::41, 0, 1)); // adds the gold block into the players inventory if interacted with the experience bottle }else{ if($hand->getID() === 332) // 332 is the snowball $player->getInventory()->addItem(Item::get(Item::41, 0, 1)); // adds the gold block into the players inventory if interacted with the snowball }}
What I mean Is when you use enchant bottled the bottle in your inventory increases in size then goes back to its normal size how would I do that with a golden block
I think there is already a small animation for it? Am i right? When you receive an item it goes small then big. This is in vanilla MCPE.