AnimalRevenge

Discussion in 'Archived: Plugin Requests' started by SnowPatch, May 29, 2014.

  1. Offline

    SnowPatch

    Hello.

    I would like to get this fun little plugin made.

    Suggested name: AnimalRevenge

    Description: I would like animal to have x% chance to "take revenge" upon death. In the config file i want to be able to:
    - Set the animal that should take revenge.
    - Set the chance in % that the animal takes revenge upon death.
    If we say like the animal is a chicken and the chance of revenge is 1%. Then when the chicken takes revenge, it spawns 10 chickens that tries to kill you. I would also like to be able to set their damage in config. Like set their damage to 0,2 hearts per individual hit.

    When would i like it done?: As fast as possible
     
  2. Offline

    Zupsub

    Nice idea. Will taking a look on it this weekend if nobody tries to do that :)
     
  3. Offline

    martinke123

    Nice idea :) But the problem is that i can't make it XD
     
  4. Offline

    SnowPatch

    Bump. Could anyone please look in to this? :)
     
  5. Offline

    Melonita

    You have to look in vanilla code for this.
     
  6. Offline

    Zupsub

    I made it, but you have to install the citizens bukkit plugin.
     
  7. Offline

    unforgiven5232

    SnowPatch i can make this, but not with neutral mobs seeing how NMS code is hard to deal with. But just spawning 10 zombies will be easy
     
  8. Offline

    SnowPatch

    Unfortunately, it must be neutral mobs since they are not expectet to attack ;)

    Zupsub could you please provide us with a download, if you (as you say) have made it? :)

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jul 1, 2016
  9. Offline

    Zupsub

  10. Offline

    Onlineids

  11. Offline

    timtower Administrator Administrator Moderator

    Not meant to do a lot:
    code (open)
    Code:java
    1. public class Main extends JavaPlugin
    2. implements Listener
    3. {
    4. public Main()
    5. {
    6. new HashMap();
    7. }
    8.  
    9. public void onEnable()
    10. {
    11. Main localMain = this;
    12. int i = 0;
    13. try
    14. {
    15. CitizensAPI.getNPCRegistry();
    16. }
    17. catch (Exception localException)
    18. {
    19. i = 1;
    20. }
    21. if ((i != 0) || (CitizensAPI.getNPCRegistry() == null))
    22. {
    23. Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "MobRevenge needs the Citizens2 plugin to work!");
    24. Bukkit.getConsoleSender().sendMessage(ChatColor.RED + "Since we cannot find it, MobRevenge will be disabled!");
    25. Bukkit.getPluginManager().disablePlugin(localMain);
    26. }
    27. null.reloadConfig();
    28. null.getConfig().addDefault("percent", Integer.valueOf(20));
    29. null.getConfig().addDefault("amount", Integer.valueOf(5));
    30. null.getConfig().addDefault("customName", "Revenger");
    31. null.getConfig().addDefault("damage", Integer.valueOf(2));
    32. null.getConfig().options().copyDefaults(true);
    33. null.saveConfig();
    34. new Random(Bukkit.getServer().getPort() * System.currentTimeMillis());
    35. Bukkit.getServer().getPluginManager().registerEvents(this, this);
    36. }
    37. }

    Zupsub You are making weird random calls
    Code:
    new HashMap();
    new Random(Bukkit.getServer().getPort() * System.currentTimeMillis());
     
    Not less important:
    null.reloadConfig();
    Where does null come from?
     
    Onlineids likes this.
  12. Offline

    Zupsub

Share This Page