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

[New API] yaw and pitch and type

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

  1. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    hello guys this is me swagboy47
    so i am making an awesome plugin requires addmobpacket and i don't now what to file in yaw and pitch and type . can anybody tell me . sorry this is the first time i use packets :p
  2. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Look at src/pocketmine/entity/Human.php
  3. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    i need addmobpacket not addplayerpacket

    edit got it but what about type ?
  4. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    got it but what about type ? what should i put in it
  5. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Mob type ID maybe?
  6. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    id is for eid
  7. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    eid means the entity ID which is unique for each entity.
    Type ID is the 10-13, 32-36 things (for 0.8.1, we only have these mobs. I am too lazy to check the new ones but refer to minecraft wiki)
  8. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    but what do these numbers represent ?
  9. Falk
    Offline

    Falk Staff Member Global Moderator

    Joined:
    Sep 2, 2013
    Posts:
    1,706
    Plugins:
    22
    Minecraft User:
    Falkirknh
    The mob type. The eid is for managing each entity.
  10. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    steel didn't get it . like hostile and passive mobs ?
  11. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
  12. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
  13. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
  14. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Basically, the EID of an entity represents that this entity is the ?th entity spawned on this server. This value is not absolutely in this order, though, but you can understand it as the unique ID which, when you refer to this ID, you will only get one entity.

    As for type ID, it tells the client what mob it is. If it is a creeper, it sends 33. If it is a chicken, it sends 10.
  15. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    i steel don't get it . example well solve it . please
  16. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Think about this:
    Now, you are the MCPE client. The server asks you to spawn a mob to your user and later on move the mob. What do you want the server to tell you?
    1. The location of the mob.
    2. The type of the mob. (By knowing the type of the mob, you can show the correct texture and shape of the mob to your player.)
    3. The body actions (head rotations a.k.a. yaw and pitch, crouch or not, on fire or not, taking damage or not, these included as the metadata) of the mob.
    4. The ID of the mob. (By registering a unique ID for the mob, later on when the server tells you to move the mob, it will have to tell you the ID of the mob so you can recognize that it is THIS mob that you want to move)
  17. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    GOT IT !!!! YAY
  18. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    The mob metadata will need some research to find it out how to create it.
  19. PEMapModder
    Offline

    PEMapModder Notable Member Plugin Developer

    Joined:
    Oct 9, 2013
    Posts:
    7,294
    Plugins:
    11
    Minecraft User:
    PEMapModder
    Look at the update of the post.
  20. swagboy47
    Offline

    swagboy47 Active Member

    Joined:
    Jun 10, 2014
    Posts:
    445
    Minecraft User:
    swagking
    can you use the same eid for every mob . because i am not can move the mobs

Share This Page

Advertisement