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

Solved Entity spawn bug

Comments in 'Plugin Development' started by Ragnok1234, Sep 18, 2016.

  1. Ragnok1234
    Offline

    Ragnok1234 Active Member

    Joined:
    Jul 18, 2016
    Posts:
    53
    Minecraft User:
    Ragnok123
    Hello. I'm maked simple plugin, that allow to spawn entity. But when I restart server, entity due unknow reasons is despawning. I tried to use slapper, but this have same problem. Any idea?
  2. PaulchenHD
    Offline

    PaulchenHD Active Member

    Joined:
    Jan 17, 2016
    Posts:
    111
    Minecraft User:
    Paulchen_HD
  3. Ragnok1234
    Offline

    Ragnok1234 Active Member

    Joined:
    Jul 18, 2016
    Posts:
    53
    Minecraft User:
    Ragnok123
    Here:
    PHP:
                        if(strtolower($args[0]) == "bridges"){
                            
    $nbt = new CompoundTag ("", [ 
                                
    "Pos" => new ListTag"Pos", [ 
                                    new 
    DoubleTag(""$sender->x),
                                    new 
    DoubleTag(""$sender->$sender->getEyeHeight()),
                                    new 
    DoubleTag(""$sender->z
                                ]),
                                
    "Motion" => new ListTag "Motion", [ 
                                    new 
    DoubleTag(""0),
                                    new 
    DoubleTag(""0),
                                    new 
    DoubleTag(""0
                                ]),
                                
    "Rotation" => new ListTag("Rotation", [ 
                                    new 
    FloatTag(""$sender->yaw),
                                    new 
    FloatTag(""$sender->pitch
                                ]) 
                            ]);
                            
    $mob Entity::createEntity(Villager::NETWORK_ID$sender->chunk$nbt);
                            
    $mob->setMaxHealth(1000);
                            
    $mob->setHealth(1000);
                            
    $mob->setNameTag("┬žl┬žeTheBridges");
                            
    $mob->spawnToAll();
                        }
  4. Creeperface
    Offline

    Creeperface Notable Member Plugin Developer

    Joined:
    Nov 8, 2014
    Posts:
    1,346
    Plugins:
    4
    Minecraft User:
    CreeperFace
    is your entity registered?
  5. Ragnok1234
    Offline

    Ragnok1234 Active Member

    Joined:
    Jul 18, 2016
    Posts:
    53
    Minecraft User:
    Ragnok123
    Yes
  6. Ragnok1234
    Offline

    Ragnok1234 Active Member

    Joined:
    Jul 18, 2016
    Posts:
    53
    Minecraft User:
    Ragnok123
    Ok, fixed. Thanks you all.

Share This Page

Advertisement