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

Events for special players

Comments in 'Plugin Development' started by MyNameIsTriXz, May 12, 2016.

  1. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Hey, how can I do that an NPC is moving its head to a client, so every player on the server sees the NPC looking to him, how do I place blocks on special clients, blocks that only the speacial client sees.
  2. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    Hi, you can't!
  3. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    You can, look on BrokenLens how the NPCs look at you or on LBSG where blocks are spawning when you are going to buy a kit
    Last edited: May 13, 2016
  4. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    I can see how you could code an NPC that looks at the nearest player, not how you'd allow every player to see it looking at them though unless it was done somehow in the PM core. And making blocks spawn when you buy a kit isn't the same as each client seeing different blocks...
  5. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Others see air, you see as example a TNT
  6. ImSilencer
    Offline

    ImSilencer New Member

    Joined:
    Feb 5, 2016
    Posts:
    13
    Minecraft User:
    ImSilencer
    Congrats you can do it. I found the plugin but its firework particle. Oneeb's plugin

    Attached Files:

  7. Extreme_Heat
    Offline

    Extreme_Heat Active Member

    Joined:
    Apr 19, 2016
    Posts:
    76
    Minecraft User:
    Extreme_Heat
    I'm not really sure what specifically you're asking for.

    If you want everyone on the server to make it look like a mob is looking at them, you need to send individual entity move packets to everyone. I don't have much examples but this is something that would be relatively difficult to implement - you'll have to look into how PocketMine manages viewers to accomplish such a thing.

    Same thing for blocks only appearing on specific clients, you need to send block update packets to individual clients.
    MyNameIsTriXz likes this.
  8. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Its possible with packets.
    Primus and Jazzwhistle like this.
  9. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    You can always create your own NPC Class that features movement and packet handling, make your own methods inside the class and the result will end in Packet Handling ;)
  10. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    You can't !== it's impossible... To be more precise, until one of the Dev team decide it's worth implementing, or you learn advanced packet handling and build your own version of pocketmine, you can't xD
  11. iksaku
    Offline

    iksaku Notable Member Plugin Developer

    Joined:
    Sep 2, 2013
    Posts:
    1,130
    Plugins:
    4
    Minecraft User:
    iksaku
    Not really, anybody can make a plugin with custom classes and just redirect the actions from their Custom Entity to an existing Entity event, or even better, create a custom event.

    See also: EssentialsPE Events
    Primus, Legoboy0215 and Jazzwhistle like this.
  12. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    That's very interesting, but too advanced for me for the moment. I'd hope anyone who is able to do that tries to fix the core teleport() glitch first though
  13. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    Just load the chunks before the player is teleported :p
    Jazzwhistle likes this.
  14. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    I see this with the core tp command, no plugins...
  15. Legoboy0215
    Offline

    Legoboy0215 Notable Member

    Joined:
    Nov 1, 2014
    Posts:
    1,724
    Minecraft User:
    Legoboy0215
    What glitch?
  16. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    He means the rare glitch, that you die when you teleport.
    Jazzwhistle likes this.
  17. Jazzwhistle
    Offline

    Jazzwhistle Notable Member

    Joined:
    Dec 27, 2014
    Posts:
    364
    Minecraft User:
    Awzaw
    Rare? That depends how many players you have on your server!
  18. Luigiboy200
    Offline

    Luigiboy200 New Member

    Joined:
    May 21, 2016
    Posts:
    4
    Minecraft User:
    Luigiboy200
    I just want a NPCs that could follow you and wander. And help you

Share This Page

Advertisement