Advertisement
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[NEW API] Events and Items

Comments in 'Plugin Development' started by swagboy47, Jun 17, 2014.

  1. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    hello guys this is Swagboy47
    so i have couple of questions that i want some answers for there you go
    1.how do you find how many of particular item is in player's HAND?
    2.is player.Interact and health.entity.change (something like that) and player.action are implemented and if yes please tell me what they are in the new api
    3.and are functions are same in the new api?
  2. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    386
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
  3. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    me too. so that's why i am asking the community. maybe they have an answer.
  4. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    386
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    It does look like there is #1 though. I didnt look at the code but I saw pocketmine/event/player/PlayerItemHeldEvent.php
  5. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    i know that too but how do you know how many is the question.
  6. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    1. If you have the item you can get the count variable (which is public) from it. So it would probably $event->getItem()->count;
    2. PlayerInteract is implemented (for when a player taps a block). The others I don't think are done yet.
    3. I am not sure what you mean.
  7. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    are the function in then new api are the same as old api
    and what i mean by player.Interact is when player hits a player
  8. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    and thanks
  9. DA_Swagnemite
    Offline

    DA_Swagnemite Notable Member Plugin Developer

    Joined:
    Nov 17, 2013
    Posts:
    386
    Plugins:
    7
    Minecraft User:
    DA_SWAGNEMITE
    Are you asking how to call the event? If thats what your looking for just look at my AlwaysSpawn API update dev build on GitHub.

Share This Page

Advertisement