Hello, I am asking a short question. What's the code for popups in the new version of PocketMine Thanks, DuncanA
You can also do this PHP: $player->sendTip($message); It is similar to popup but it is higher up on screen.
Isn't $ a var sign? You can first assign a text (Or whatever you programmers call it) then just put the var in. (I think....)
$message means "an expression that is resolved into your desired message". It can be any expression, including $message if you defined it.
You can defined it like this: PHP: $message = "Hey this is a just an example"; $player->sendTip($message); I hope i helped.
But, If you wanna save time or you have to send the same message again" You should use it PHP: $message = "Hey This is just an example xD";$player->sendTip($message); <-- So You Dont Have to rewrite$player->sendTip($message); <-- You can use the same varible
There isn't any 'real time'... Computers do anything for you now. Copy and pasting will not spend you too much time. Anyway, getting off-topic. Thanks - GmWM
This is if you want an item to have a popup! PHP: public function onHold(PlayerItemHeldEvent $event) { if($event->getItem()->getId() == // I'd of item) { $event->getPlayer()->sendPopup("blah"); // Just Put something else in the "blah" part}} Oh and please learn PHP it really helps. Please look at this code and think about how it works. Just don't copy and paste. Thx!
I dont think he ask to make the popup when the player is holden an item. I think he wanted to disply the popup when players join the server or at random times.... xD But you can always make it when a player join by using the playerJoinEvent and then you get get player name then send popup I Hope i helped