Tutorial [INFO]Packets/NMS Explained

Discussion in 'Resources' started by xTrollxDudex, Sep 27, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    xTrollxDudex

    Freelix2000
    Actually, a lot of the examples I used are outdated, don't really have time to update. I'll have to take a look again.
     
  2. Offline

    Freelix2000

    xTrollxDudex
    Well, that one seemed to work fine. Since I posted that, I found that it seems what I need to do to edit the imaginary player is edit the handle that is used in the packet. Still can't find the variable for the player's name, though.
     
  3. Offline

    xTrollxDudex

    Freelix2000
    Hmm, the big thing that I can't see is the other packages in net.minecraft.server, namely the GameProfile.

    I'll take an educated guess though:
    The first parameter is UUID of the player
    The second is the nameplate String
     
  4. Offline

    Freelix2000

    xTrollxDudex
    You guessed the GameProfile parameters right... =P Do you think it will blow up if I put "null" as the UUID?

    EDIT: Yes, it did blow up with a null UUID. But it seems that it gets the skin from the UUID, but can have any nametag. I didn't know that was possible. =D

    xTrollxDudex
    One more question, if I edited the NPC's EntityPlayer's location or did something else with it after sending the packet, would I have to send another packet to all players to update the location?

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 4, 2016
  5. Offline

    xTrollxDudex

  6. Offline

    Freelix2000

    xTrollxDudex
    Okay, so it seems that it does need another packet to update location, and likely other properties as well. Do you know what packet should be sent?
     
  7. Offline

    xTrollxDudex

  8. Offline

    Freelix2000

    xTrollxDudex
    Okay, I'll play around with that a bit. But I found something odd with the NPC spawning, it seems that when an NPC is spawned, the server fails to send the break block packet to other players. At first I thought it was somehow getting the NPC mixed up with me and attempting to send it packets, but I tried with a random UUID for the GameProfile and the error still occurs. It still seems to be able to send other packets, though.

    EDIT: I think I figured that out, I was using my own CraftPlayer instance's interact manager for the packet, so I guess it was trying to send packets to the NPC when I broke a block or interacted with something. I'll replace it with a new instance. Thank you so much for this great tutorial and the further assistance, you're awesome. =)
     
    xTrollxDudex likes this.
  9. Offline

    ItzzBrandon

    Which packet I will need to create mobs will attack players an example: pigs that attack players
     
  10. Offline

    RingOfStorms

    Good luck.
     
    Eccentric_Gamer likes this.
  11. Offline

    xTrollxDudex

    Packet is information data, not actions.
     
  12. Offline

    ItzzBrandon

    O haha sorry next time I will read better maybe it's because I'm from The Netherlands so it's not so easy to read
     
  13. Offline

    DevRosemberg

  14. Offline

    ItzzBrandon

    Ok thanks
     
Thread Status:
Not open for further replies.

Share This Page