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

Change the player into a Villager and save a players skin as a png?

Comments in 'Plugin Development' started by WrackD, Aug 8, 2015.

  1. Timmpann
    Offline

    Timmpann New Member

    Joined:
    Feb 5, 2015
    Posts:
    24
    Minecraft User:
    Timmpann
    Got it! :D
    PHP:
            public function onPacketSend(DataPacketSendEvent $event){
                if(
    $event->getPacket() instanceof AddPlayerPacket  && $event->getPacket()->username === "Chicken"){
                      if(
    $event->getPacket() instanceof AddPlayerPacket){
                              
    $pk = new AddEntityPacket;
                              
    $pk->eid $event->getPacket()->eid;
                              
    $pk->type 10;
                              
    $pk->$event->getPacket()->x;
                              
    $pk->$event->getPacket()->y;
                              
    $pk->$event->getPacket()->z;
                              
    $pk->pitch $event->getPacket()->pitch;
                              
    $pk->yaw $event->getPacket()->yaw;
                              
    $pk->metadata = [];
                              
    $event->getPlayer()->dataPacket($pk);
                              
    $event->setCancelled();
                      }
                      if(
    $event->getPacket() instanceof MovePlayerPacket){
                              
    $pk = new MoveEntityPacket;
                              
    $pk->entities = [[$event->getPacket()->eid$event->getPacket()->x$event->getPacket()->y$event->getPacket()->z$event->getPacket()->yaw$event->getPacket()->pitch]];
                              
    $event->getPlayer()->dataPacket($pk);
                              
    $event->setCancelled();
                      }
                      if(
    $event->getPacket() instanceof RemovePlayerPacket){
                              
    $pk = new RemoveEntityPacket;
                              
    $pk->eid $event->getPacket()->eid;
                              
    $event->getPlayer()->dataPacket($pk);
                              
    $event->setCancelled();
                      }
                }
            }
    thebigsmileXD likes this.
  2. thebigsmileXD
    Offline

    thebigsmileXD Banned

    Joined:
    May 19, 2015
    Posts:
    845
    Plugins:
    1
    Minecraft User:
    XenialDan
    Bit annoying that it has to connect to your server
  3. Luigiboy200
    Offline

    Luigiboy200 New Member

    Joined:
    May 21, 2016
    Posts:
    4
    Minecraft User:
    Luigiboy200
    When you are a villager. Are YOU a png???o_O
  4. minebuilder0110
    Offline

    minebuilder0110 Notable Member

    Joined:
    Dec 8, 2014
    Posts:
    485
    Minecraft User:
    Apparitional
    What? You don't make any sense at all... PNG is an image format.
    Last edited: May 21, 2016

Share This Page

Advertisement