Create A Plugin To Make Animals Peaceful But Enemies Aggressive

  • Guys, I have to admit, I am ignorant when it comes to making plugins. I have done research & read things here on the forums, but I am totally lost. I was wondering if someone could make a plugin for me, if this type of plugin would even be possible. I want to be able to keep animals peaceful but bandits, skeletons, etc... aggressive. Would this be possible? Would anyone be willing to do it. I'll pay for it if I have to. Lol. Thanks in advance!

  • If I remember correctly I don't think that is currently possible via the plugin API, but you might be able to do it locally for your game by changing some entries in the game's definitions database. If you are interested in that way it is a bit more involved than simply installing a plugin but I might be able to walk you through it :)

  • should be totally possible but im busy coding PVP zones witch is working now but under testing and then ill release it

    76561198018554331.png


    :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:


    If at first your code does not work call it version 0.1 with the odd bug :S

  • If I remember correctly I don't think that is currently possible via the plugin API, but you might be able to do it locally for your game by changing some entries in the game's definitions database. If you are interested in that way it is a bit more involved than simply installing a plugin but I might be able to walk you through it :)

    getAttacker()Gets the attacking npc, i.e. the npc who hit the target npc. if attaking name = skeleton{ setCancelled(true) }

    this would be under the NpcHitNpcEvent

    76561198018554331.png


    :thumbsup: Rising Citys @ ip 74.118.138.151:4265 ServerName (Yahgiggles Rising Citys) :thumbsup:


    If at first your code does not work call it version 0.1 with the odd bug :S

  • But that is not a solution, the animal would still try to run up to the player to attack it would simply just not deal damage :/


    So if you wanted to have the hostile animals in a zoo or something they would always escape to run up to players and try to attack them but would end up not dealing damage to them.


    A real solution would be to set the hostile status of certain animals via the API which is not possible as far as I can tell.

  • If I remember correctly I don't think that is currently possible via the plugin API, but you might be able to do it locally for your game by changing some entries in the game's definitions database. If you are interested in that way it is a bit more involved than simply installing a plugin but I might be able to walk you through it :)

    Thanks so much! Actually, my hubby has volunteered, if you're willing to walk him thru it. He is getting into some programming & such that he said this would be good experience for. He was wondering what software you recommend for the editing though.

  • Sorry for the extreme delay in replying, I got caught up at work with a few important things.


    So what you will need is a database browser I recommend DB Browser for SQLite: https://sqlitebrowser.org/

    Then you need to go to the game's files and extract the definitons.db from the commons.jar archive. That is found inside the archive under commons/definitions/definitions.db

    Then you need to open the definitions.db with the DB Browser and navigate to the table named Npcs.

    There find the animals you want to change the behaviour of and set the behaviour field from AGGRESSIVE to DEFAULT.

    Then save the changes via the "Write Changes" button and repack the definitions.db to replace the other one in the commons.jar archive


    If you have any more questions feel free to let me know :)

Participate now!

Don’t have an account yet? Create a new account now and be part of our community!