Development Assistance Setting NBT data on mobs

Discussion in 'Plugin Help/Development/Requests' started by Fruitninja567, Feb 15, 2015.

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

    Fruitninja567

    Hey there!
    I'm making a plugin that requires me to have mobs that don't move. And with don't move I mean that they should be like statues, no gravity, no AI and they should always look in the same direction. Now in 1.8 there is this NBT data tag thats called NoAI and it does exactly that. My question is, how do I set the NoAI-NBT data of of a skeleton from 0 to 1? is it done with setMetaData? I have no clue.
     
  2. Online

    timtower Administrator Administrator Moderator

    Moved to Bukkit alternatives.
     
  3. Offline

    pie_flavor

    @Fruitninja567 If there's no Bukkit method for it, there's a simple but dirty way to do it. Get the UUID of the entity, then do Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "entitydata "+id+" {NoAI:1}");
     
  4. Offline

    Fruitninja567

    Hmm, tried it but it doesn't work for me, did I do something wrong?
    I did this:
    Code:
           Entity en = b.getWorld().spawnCreature(b.getLocation().add(0.5,-1,0.5), CreatureType.SKELETON);
           Bukkit.dispatchCommand(Bukkit.getConsoleSender(), "entitydata " + en.getEntityId() + " {NoAI:1}");
    Whereas b is a block.

    EDIT: Nevermind, Thank you! I changed it to getUniqueID() it works now.
     
    Last edited: Feb 15, 2015
Thread Status:
Not open for further replies.

Share This Page