Separate names with a comma.
Comments in 'Plugin Development' started by Xfusionios, Nov 19, 2013.
Can anyone tell me how do get block id of touched block is they have a certain item in their hand?
$id = $data["target"]->getId();
That give block id touched or the item in hand?
I never really understood event functions.
The item touched, wies can tell you how to get the one of the item in hand
I think the item in the hand would be part of the player data, check out player.php maybe?
I think it is: $data["item"]->getId();
That would make sense but there should be a function inside the player object as well
I looked in the src, it is $data["item"]->getId();
whats the addHandler?
It adds an event like when a player spawns, dies, touches something etc.
I believe the event for this is block.touch
Ok thanks is there a list of events I don't know of?
Yes, on the PocketMine wiki there is an alphabetical list and another with thats divided into categories: https://github.com/PocketMine/Documentation/wiki/Event-Documentation-Portal
Yeah, the src xD
Whats player.armor do?
I think the player armor change?