Spawn Creepers with Nametags!

Discussion in 'Nukkit discussions and help' started by LucGamesHD, 6/3/16.

  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice
We welcome you on our site. This site is devoted to the Nukkit project and all that is connected with him. Here you can communicate, download plugins, also many other things get acquainted! Register the account right now :3
  1. LucGamesHD

    LucGamesHD Developer

    Messages:
    26
    Likes Received:
    10
    Minecraft:
    LucGamesYT
    Hey i have a methode to spawn creepers with nametags and more!
    Have Fun! ;D

    Cc23DAAW0AAGR7p.jpg

    Code:
     @Override
    public boolean execute(CommandSender sender, String arg1, String[] args) {
    Player p = (Player)sender;
    
    [pre][code]    if(args.length == 0){
            Block block = p.getLocation().getLevelBlock();
            Level level = p.getLevel();
            level.loadChunk(block.getFloorX(), block.getFloorZ());
            FullChunk chunk = level.getChunk((int)block.getX(),(int) block.getZ());
            CompoundTag nbt = new CompoundTag()
            .putList(new ListTag<DoubleTag>("Pos")
                    .add(new DoubleTag("", block.getX() + 0.5))
                    .add(new DoubleTag("", block.getY()))
                    .add(new DoubleTag("", block.getZ() + 0.5)))
            .putList(new ListTag<DoubleTag>("Motion")
                    .add(new DoubleTag("", 0))
                    .add(new DoubleTag("", 0))
                    .add(new DoubleTag("", 0)))
            .putList(new ListTag<FloatTag>("Rotation")
                    .add(new FloatTag("", new Random().nextFloat() * 360))
                    .add(new FloatTag("", 0)));
    
            EntityCreeper ent = new EntityCreeper(chunk, nbt);
            ent.setNameTag("§3§lIch bin Klausi");
            ent.spawnToAll();
        }
    
        return true;
    }
    [/code][/pre]
     
    Tee7even, MrPowerGamerBR and M4Gn1T like this.
  2. fromgate

    fromgate Administrator

    Messages:
    664
    Likes Received:
    186
    Nice! Great! Hope sometime creepers will walk and explode :)
     

Share This Page