Mob manipulation

Discussion in 'Plugin Development' started by bodhistrontg, Nov 29, 2013.

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


    So i'm trying to make a mob where when i type /nskelly it will spawn a seletons to hold axes instead of bows they stay still and every 3.5 second they throgh an axe at you if your in a range of 20 blocks my friend said to id hook it up so they shoot snowballs replace the snowball entity to the axe item as for spawning in one you'll need to use packets make it so the entity doesn't want to move and it will target players but i have no clue how to do could some one show me how or show me the some helpful bukkit javadocs i can use! Thanks


    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
    Last edited by a moderator: Jun 5, 2016
  2. Offline


    Here's the code to spawn a skeleton with a diamond axe instead of a bow. I know it's not exactly what you asked for, but here's a start for you :D

    1. @Override
    2. public boolean onCommand(CommandSender sender, Command cmd,
    3. String commandLabel, String[] args) {
    4. Player player = (Player) sender;
    5. if (commandLabel.equalsIgnoreCase("test")) {
    6. Skeleton skeleton = (Skeleton) player.getLocation().getWorld()
    7. .spawn(player.getLocation(), Skeleton.class);
    9. ItemStack axe = new ItemStack(Material.DIAMOND_AXE);
    10. skeleton.getEquipment().setItemInHand(axe);
    11. }
    12. return true;
    13. }
    bodhistrontg likes this.
Thread Status:
Not open for further replies.

Share This Page