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

Skin and nametag datapacket

Comments in 'Plugin Development' started by MyNameIsTriXz, Aug 17, 2016.

  1. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    What is the code to send a player a datapacket where a human entity's skin and nametag are getting changed?
    Last edited: Aug 17, 2016
  2. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    I don't think you can change mobs skins , they are client side
  3. MCPEPIG
    Offline

    MCPEPIG Notable Member

    Joined:
    Jun 22, 2014
    Posts:
    349
    Minecraft User:
    MCPEPIG
    $player->setSkin($skindata, $skinname); && $player->setNameTag("Pig"); :p
    applqpak and MyNameIsTriXz like this.
  4. Svile
    Offline

    Svile Active Member

    Joined:
    Mar 30, 2015
    Posts:
    239
    Minecraft User:
    svile
    Entity != Player
  5. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Entity is superclass for Player it means: Player == Entity

    Only Human entity is possible to change skin!
    PHP:
    Human::setSkin(string $skinDatastring $name)
    Entity::setNameTag(string $nameTag);
    applqpak, MyNameIsTriXz and Survingo like this.
  6. MyNameIsTriXz
    Offline

    MyNameIsTriXz Notable Member

    Joined:
    Aug 17, 2015
    Posts:
    538
    Minecraft User:
    MyNameIsTriXz
    Thanks, and yeah I meant on Human.
    And I want to set a nametag and skin foreach player (the skin of the player and information about the player to be precisely), so how can I set these 2 things for each player?
  7. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Just make a foreach loop for all players on the server?
    PHP:
    foreach($serverObject->getOnlinePlayers as $player){
    //setSkin and Nametag
    }
    MyNameIsTriXz likes this.
  8. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    If you state that two things are equal, they must be symmetric. If Player == Entity, Entity == Player must be true as well. In your case, using == is entirely wrong.
    http://stackoverflow.com/questions/13162188/java-equals-method-in-base-class-and-in-subclasses
    applqpak and HotFireyDeath like this.
  9. Tim // robske Büba
    Offline

    Tim // robske Büba Notable Member

    Joined:
    Feb 26, 2014
    Posts:
    606
    Minecraft User:
    robske_110
    Wait every player is a human but not every human is a player sounds philosophical.
    Ever human is an entity but not every entity is a human
    dktapps likes this.
  10. SOFe
    Offline

    SOFe Banned

    Joined:
    May 28, 2016
    Posts:
    386
    Minecraft User:
    Herobrine
    The coverage of PocketMine concepts is actually still not large enough. It is too limited to traditional understanding.
    Creative server concept should be (insanity alert) (creativity test) (but really possible!):
    • A client can control multiple players (control other players as well?),
    • or no players (a proxy server?).
    • And a player can have multiple (an IRC bridge for easy chatting?),
    • or no connected clients (Specter?).
    • And a player can be composed of multiple entities (what if we have a plugin that allows a player to duplicate himself with magic?) (what about a player wants to change how he looks and decides to move like a compound entity?),
    • or a non-player entity (disguise),
    • or no entities (secure invisibility).
    • And the same server socket can accept connections for multiple protocols (you can even make an IRC bridge and an MCPC server at the same port),
    • or no protocols (I'm not creative enough; are you creative enough to think of a usage?).
    • And the position of an entity spawned in a world might not be sent as-is to players
      • [proof of concept needed] a world with infinity height? (@PEMapModder mentioned it in a post once, but I can't find it)
      • [proof of concept needed] efficient world swapping by sending translated coordinates? (@PEMapModder posted a thread explaining about this theory once, but it was pure theory and didn't receive much attention, and I forgot the keywords to search for that thread)
    These are not crazy. Having multiple worlds possible on the same server is already the first step of this kind of creativity.

    This repo, Project Nyx, is @PEMapModder's last piece of work (he will never work on this again) that introduces these concepts into server software. The code in this repo doesn't work and isn't going to get worked on anymore, so this doesn't compose advertisement, but it half worked (client could get into the layer of sending the LoginPacket in the first commit), so it can act as a proof of concept of what I'm talking about.
    Last edited: Aug 19, 2016
    Survingo and applqpak like this.
  11. Primus
    Offline

    Primus Notable Member

    Joined:
    Apr 7, 2015
    Posts:
    1,470
    Minecraft User:
    PrimusLV
    Off-topic: Awesome, starting to love Nyx :D

Share This Page

Advertisement