Inactive [FUN/MECH] AnimalCompanion v0.3.2 - Make man's best friend into a companion, Wolf Plugin [1060]

Discussion in 'Inactive/Unsupported Plugins' started by TheTennessee, Aug 19, 2011.

  1. Offline

    TheTennessee

    AnimalCompanion - Make man's best friend into a companion, Wolf Plugin
    Version: 0.3.2
    Tested with: CB 1060

    Latest JAR:
    MediaFire - <Edit by Moderator: Redacted mediafire url>
    MegaUpload - Version 0.3.2 JAR

    Older Versions:
    MegaUpload - Version 0.2.1 JAR
    MegaUpload - Version 0.1 JAR

    My second plugin, AnimalCompanion, is a fully featured wolf plugin to give ultimate control and utility to your tamed wolves. Tired of your wolves dieing and being quite frankly useless? Did you just install AdvancedMobs, tame yourself a HellHound, and had it die on you to a ghast? Well, fear no more. This plugin makes your wolf into an animal companion (ala the rangers/druids of D&D fame). These special wolves toughen up over time, are smarter, and can be controlled much more effectively. Best of all, they can follow you between worlds, so your new HellHound isn't stuck in the nether.

    <font color="rgb(255, 0, 0)">Important: If you find any bugs or adherent behaviors while using this plugin, please give a list of the wolf changing plugins you have besides this one, the startup messages for AnimalCompanion (it will show [AnimalCompanion] in front of it) as well as any errors you get in the console. Your config file would also be helpful if you changed any values. </font><font color="rgb(255, 0, 0)">Also be sure to include your CB version. I will not be responsible for versions I don't support.</font>

    <font color="rgb(0, 0, 255)">NoSuchFieldError: PROJECTILE:</font>

    <font color="rgb(0, 0, 255)">Do not post about this error if you are not using CB 1060. According to other posts I have found, this is what happens when you use CB 1000 with a plugin built using the CB 1060 API. DO NOT DO IT...</font>

    <font color="rgb(0, 0, 255)">And if you still get it in 1060, tell me about ALL of your plugins and if you have Spout or not.</font>

    Features:
    * Wolf cap limit (default 3)
    * Register existing wolves into the system
    * Name your wolves! (no hovering names... yet)
    * Wolves will respawn when they die
    * Damage Resistances

    - * Set up immunities by damage type (defaults are Suffocation, Drowning, Void, Fire, and Lava, but not FireTicks from being caught on fire)
    * Max Fire Ticks can make fire last a shorter period of time on your wolf
    * Fall Damage Reduction can reduce the falling damage a wolf will take
    - Anti-griefer protection
    * Offline protection makes your wolves not take damage when you aren't there
    * PvP protection makes your wolves not take damage in no PvP areas as well as from it's owner
    - Better behaved wolves!
    * You can now finally make your wolf STOP attacking your friend by telling it to sit
    * Wolves won't ever attack you, or other wolves you own
    * Wolves can feed themselves with any pork they find on the ground (off by default, but great for hunter mode)
    - Improved AI modes!
    * Default - just the way it normally works
    * Passive - won't attack anything, period
    * Defensive - anything that targets you will get it
    * Aggressive - if there are hostile mobs around, they are going down
    * Hunter - for hunting dogs, makes them attack animals
    - Multiworld support - Your wolves will follow you through nether gates and when you teleport between worlds
    * Locate and teleport your wolves when they get too far away
    - Pump up your pooch!
    * A level system allows your wolf to get better as it kills more mobs
    * Increased Bite Damage
    * Damage Resistance
    * Evasion percentage
    * Customizable EXP tables
    - AdvancedMobs support (version 0.3.5 and up)
    * Make HellHounds, Winter Wolves, and the secret wolves into your companion
    - Use a leash item (default string) to control your wolf
    * Left click with the leash from any distance to send your wolf after a target
    * Right click on your wolf to access its inventory without a command
    - Store inventory in a wolf when you equip him with a pack
    * Persistent between respawns and server restarts
    * Just right click on your wolf with a chest to make him into a pack wolf
    - Permissions Support!

    Commands:


    Show Spoiler
    /animalcompanion - prefix to ALL commands
    /ac - shortened version also works
    -------------------------------------------------
    /ac setname or /ac rename - renames your wolf to a different name
    Usage: /ac setname [current name] [new name]
    Example: /ac setname George Rex
    Permissions Node: animalcompanion.ownwolves

    /ac teleport or /ac tp - Teleports your wolf to you
    Usage: /ac tp [name]
    Example: /ac tp George
    Permissions Node: animalcompanion.teleport

    /ac location or /ac loc - tells you the location of your wolf to help you find him
    Usage: /ac loc [name]
    Example: /ac loc George
    Permissions Node: animalcompanion.locate

    /ac setai or /ac ai - sets the AI to the AI type you specify
    Alternative: Left clicking on your wolf with a bone in hand will switch between modes
    Usage: /ac ai [name] [ai type]
    Example: /ac ai George Aggressive
    Permissions Node: animalcompanion.setai

    /ac inventory or /ac inv - If your wolf is a packwolf, causes you to open its inventory
    Alternative: Right click your wolf with the leash item
    Usage: /ac inv [name]
    Example: /ac inv George
    Permissions Node: animalcompanion.pack

    /ac info - Gets information about the wolf, including his current AI type, his health, and his wolf type
    Alternative: Right clicking on your wolf with a bone will give you this info too
    Usage: /ac info [name]
    Example: /ac info George
    Permissions Node: animalcompanion.info

    /ac list - Gets the names of all of your loaded animal companions
    Usage: /ac list
    Example: /ac list (that's really it)

    /ac dismount - dismount a wolf that you are riding
    Alternative: Right click your wolf with a leash item
    Usage: /ac dismount [name]
    Example: /ac dismount George
    Permissions Node: None to dismount, but animalcompanion.ride to mount in the first place

    /ac makenormal - Will make the selected companion a normal wolf (sans rideable or pack status, not AdvancedMobs variants)
    Usage: /ac makenormal [name]
    Example: /ac makenormal George

    /ac release - Releases your wolf back into the wild (kills it since special wolves would then attack you)
    Usage: /ac release [name]
    Example: /ac release George (No, not George!)



    Permissions:


    Show Spoiler
    animalcompanion.* - Enable everything
    animalcompanion.ownwolves - The ability to tame wolves at all
    animalcompanion.register - Turn a wolf into an animal companion
    animalcompanion.infinitewolves - The wolf cap does not apply to this person
    animalcompanion.respawn - These wolves will respawn when they die
    animalcompanion.setai - The ability to change the wolf's ai to something other than default
    animalcompanion.locate - Find out where your wolf is
    animalcompanion.teleport - Teleport your wolf to you
    animalcompanion.info - Get the advanced info about your wolf
    animalcompanion.level - These wolves can gain exp and level up
    animalcompanion.multiworld - Your wolves will follow you between worlds
    animalcompanion.leash - Use the leash item to make your wolf target an enemy or access inventory
    animalcompanion.pack - Make your wolf into a pack wolf to carry items
    animalcompanion.ride - Make your wolf into a rideable wolf with a saddle



    Change Log:

    Version 0.3.2
    * Fixed a registration bug
    * Added the list command for getting the names of your animal companions


    Version 0.3.1
    * Removed some instances of "NullPointerException"
    * Fixed level benefits calculation
    * Made a check for wolf cap limits during animal companion registration
    * Fixed wolves attacking other wolves in some AI modes
    * Wolves now re-link to the animalcompanion plugin every time you right click them or when they die. This should help prevent the need to restart the server if the plugin loses track of the wolf somehow.

    Version 0.3
    * Fixed a bug where the owner could damage his wolf if he changed worlds and came back
    * Fixed a few AI targeting bugs
    * Added the leash item

    - * Left click with it to make your wolves target a specific enemy, aim near legs for best results
    * Right click with it to access the features of a pack wolf/rideable wolf
    - Added the ability to make pack wolves with a chest
    - Added the ability to make rideable wolves with a saddle
    * This is still extremely glitchy, and is disabled by default
    * Right click on your wolf with a saddle to make him rideable, then right click with the leash to get on him
    * Left click with the leash to point your wolf in the direction you want to go, he will pathfind there
    * I won't be supporting any bugs that you come across with riding a wolf. I already know it needs more work
    - Added "AutoSaveDisplay" option to the config file, to turn on and off the auto save messages
    - Added "RenameOnTame" option to the config to help prevent conflicts with other chat plugins
    - Added a distance check to the TP command, so wolves will teleport even if sitting if you are in range
    - Fixed quite a few NullPointerException errors. I hate them so very much


    Show Spoiler
    Version 0.2.1
    * Finally fixed the cast arrow to living entity error, it still exists in bukkit, but I am catching and blocking the instances now
    * Solved a bug where if the player teleported between worlds, he could damage his wolves
    * Redid the order that the damage listener catches instances of damage that should be blocked, should be more efficient
    * added the "contact" damage case, and immunity. This is called when something touches a cactus

    Version 0.2
    * Fixed a bug where aggressive and hunter AI targetting would cause wolves to chase a target but never attack
    * Fixed a bug where PvP protection wasn't canceling damage properly
    * Fixed an error to the console when trying to run a command with the wrong number of arguements
    * Added some messages when entering a command incorrectly
    * Added the hungry wolves variable to config. Off by default, but when on, wolves will eat nearby pork on the ground to gain health
    * Left clicking with a bone will now change your companion's AI type
    * Permissions support!

    Version 0.1
    * Initial Release



    Known Issues:
    * Error:

    org.bukkit.craftbukkit.entity.CraftArrow cannot be cast to org.bukkit.craftbukkit.entity.CraftLivingEntity
    * Sometimes wolves won't respawn - I think this is fixed
    * Sometimes when wolves respawn, they won't respond to you - I think this is fixed
    * Aggressive and Hunter modes can sometimes send wolves on a wild goose chase for mobs behind a wall
    * Sitting wolves can't be teleported, disabled it in the command
    * If you set up loot for angry wolves with another plugin like OtherBlocks, tamed wolves will drop loot when respawning/teleporting sometimes
    * As of 1060, increased damage from the wolf's level will not get applied, because 1060 is not allowing damage changes to take effect


    Planned Features:
    * Permissions support (on or before 0.2)

    - * Native bukkit permissions support?
    - Health regen - a specific rate at which they will regain health, will likely be very very slow
    - Respawn health amount - the amount of health they respawn with, not just respawn at full
    - Leash/Control item - probably string by default, will direct your wolves who/what to attack
    * Right clicking with leash will cause wolves to stop targeting their target and come back to you
    - Change AI type by hitting your wolf with a bone
    - Add a line of sight check somehow to keep wolves from attacking through walls in certain AI modes
    - Spout support (for floating names/different skins/better inventory management/riding control)
    - PvP AI mode for PvP arenas, like Aggressive, but against players only
    - Integrate with other plugins to find PvP areas as well as certain plugins to find out if one player is on the same "team" as another player for PvP modes

    Possible Features:
    * Permissions based wolf caps/level caps
    * Pack wolves to carry your items
    * Ride-able wolves, that you can direct with the leash item (Still glitchy, still being worked on)

    Look in my signature for the link to AdvancedMobs
     
    Last edited by a moderator: Nov 12, 2016
    Omni_i and Kain888 like this.
  2. Offline

    kalez

    Yeah thats exactly what i figured. Purge is a great spell for exploring caves or mining, but ive lost many a normal tamed wolf to it accidentally lol. But, yeah! A respawn "name" command would be awesome if nothing else.
     
  3. Offline

    F_Synchro

    I apparently cannot use this without the permissions plugin, and since I don't want to go through the process of setting all of that up, I won't install this plugin, I only have 10 people on my server and it works fine that way, I don't want to setup an entire group system to make it work.
     
  4. Offline

    hainkiwanki

    Eum...how i get leash item?
    And if i right click with saddle on my dog i cant mount it :( Help pls
    Edit : Craftbukkit 1060 - Check
    Other plugins :
    Essentials, craftbook, permissions, mobdisguise, godpowers, chestshop, safecreeper, worldedit, worldguard, lockette
     
  5. Offline

    kalez

    Found out something else interesting. If you have a fly ability and fly up high where they obviously cannot go, and then away out of sight, land and try to tp them to you, nothing happens, and then if you try to locate them it says they are right where you are. If you logout and back in, and try to locate them it says they are not loaded in any world. BUT if you go back to the last place you left them, there they are. BUT AGAIN, they seem to be stuck in default mode, regardless of what mode you change them to, until you restart the server. Killing them to make them respawn doesnt fix it, and they will not tp by command or change modes until you restart the server.

    Also, i have the pvp protection on, and we dont have any pvp plugins, and i am not able to attack my dogs, but my friend was able to.

    RB1060
    AC 0.3
    Also have AdvancedMobs0.3.7 installed

    P.S. is there a way to adjust the exp rate, besides adjusting the mobs exp?

    he says in the op that the riding is extremely buggy, but you have to use a leash to mount it. you dont wanna know all the weird things that happened while i was riding a dog. a leash is whatever you set it to, by default its a string.

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  6. Offline

    TheTennessee

    It sounds like maybe his AI thread has somehow been interrupted. After a server restart, it should work again. Were there any errors earlier on? I have been trying to track all of them down.

    @F_Synchro really? Because the hasPermissions() function I wrote checks for permissions and if it isn't found it should always return true. What is it doing on your end?

    @hainkiwanki By default, the leash item is a simple string, that's all you need to use. Also, you'll need to go into the config and enable riding to test it. It was turned off by default because it is unfinished.

    @kalez That is one of those things that I tried to prevent with the tp command. If -ever- a wolf is tp'ed when it isn't loaded, it will do that, that's why I have to be so finicky with it. Evidently by flying, you managed to go outside of its range without it sitting. I will have to find some way to check for that, but it's dang near impossible as is.

    I will look into the PvP protection problem. Seems maybe something that I did recently may have messed that up. I have PvP off on my server, so if it was something I did shortly after the release, I might not have noticed that it broke.

    And no, you just need to change the mob EXP rates. It uses a simple algorythm to determine what EXP is needed to level, because that way it is infinite. So... it's level X level X 1000, level 1 to 2 is 1000 exp, 2 to 3 is 4000 exp, etc, but also since you had 1000 already, it appears as only 3000 exp to reach the next level... And with 3 to 4, it's actually 9000 exp, but it only shows as 5000 because you had 4000 just to reach it.
     
  7. Offline

    kalez

    ah ok, thats fine then for the exp. and the tp issue isnt only when sitting.

    New issue i just noticed. If one dog is set to hunter, and another is set to defend or aggressive, if the hunter attacks something, the other dog(aggressive/defend) will try to kill the hunter. ive tested it with both my dogs with either of them being the hunter and it happens every time. ones a normal, ones a hellhound.
     
  8. Offline

    TheTennessee

    Alright, thank you Kalez. This gives me something to work off of when I am trying to fix it. Also, by try, do you mean that it tries to attack but is unable to do any damage (they shouldn't be able to do damage to each other at all) or do you mean they flat out rip each other's throats out?
     
  9. Offline

    kalez

    It seems the hellhound can attack the normal, it makes the hurt sound, though i havent let it go on long enough for it to die, but when the normal tries to attack the hellhound, the hellhound seems to ignore it.

    EDIT: Yes, the hellhound killed the normal when i let it go on
     
  10. Offline

    TheTennessee

    It's because of the hellhound's fire bite. It's actually not doing any bite damage, it is applying fire ticks, which is something I can't really stop due to the nature of both plugins. I will try and find some way to get them to stop attacking each other. Maybe it has happened somehow with the vanilla minecraft code. I could actually set their target to null in the damage event where I block damage. Hopefully then, it will cause them to stop attacking.

    Also @F_Synchro you MUST have permissions installed but not set up. I just did a test with permissions uninstalled, and it worked find. Check to make sure that permissions isn't somewhere in the plugins folder, because if it finds it, it WILL use it, and that's not on my end.
     
  11. Offline

    kalez

    You must be right cause it was a slow kill ( i kept checking the normal dog's health) and that could be why the normal dog wasnt doing any damage to the hellhound.
     
  12. Offline

    TheTennessee

    Yeah. One thing, until I get the update in, you can cancel a wolf's target by making it sit. So, unlike before when sitting would make them start butt hopping towards their target, they actually more or less go into a temporary passive state while sitting, which is great for saving fellow players or when glitches like this happen.
     
  13. Offline

    kalez

    Well that did work, until i unsat him, then he would continue to attack my friend, even after killing him twice. My friend had to kill the dog to make it stop.
     
  14. Offline

    TheTennessee

    Well, I think I may have found out what it is. Because the hunter is an angry wolf, even though it is tamed, it's target is the player (for following purposes). When the defensive or aggressive wolf sees an angry wolf targeting its owner, it responds to defend its owner. Well, one of the bugs that bothers me SO much, is where a tamed wolf loses it's owner for the purpose of getOwner(), but still follows and acts just fine. It means that the owner of one wolf does not equal the owner of another wolf, even though they are owned by the same player in reality. In essence, it thinks it is another player's wolf that is attacking its owner.

    I -can- stop this, but it just required some changes in how I check owner status. I have to go to the animal companion class instead of the wolf class to get the owner, and it should work fine now. I am just doing some testing over here. I never noticed before I guess because they weren't able to do damage, unless it was a hellhound, and my hellhound was always my hunter, because it cooked the pork. :p

    Okay, come next version, you won't have any more problems with them attacking each other. I am moving onto the PvP problem now.
     
  15. Offline

    kalez

    Orly? haha never thought of it that way. I figured the hellhound should be the aggressor cause it dealt more damage, but thats a good idea.
     
  16. Offline

    TheTennessee

    Well, here's how I do it... Hellhounds are hunters, Winter Wolves are defenders (their knock back keeps you safe), and the secret wolves are actually the best aggressors, they are fast on the draw and kill quicker than any of the others.
     
  17. Offline

    kalez

    Aright so i think i figured out part of the "default mode only" issue. Its not due to the tp, its when you go out far from the wolf and its not loaded. I had it on hunter and attacking a bunch of animals in the area, but when i walked pretty far out and came back, even after cycling through its modes, it wouldnt attack anything... not sure if it would attack something if i was attacked though. i think it would still. I had to reset server to get the modes to work again.

    Edit: well i think i would have to find a secret wolf first :p
     
  18. Offline

    TheTennessee

    Question, does it show anything different when you right click on him? It should show "woof!" as its message when you do and it's your animal companion. I am wondering because it could either be the AI thread, or it could be that wolf is not recognizing that it is in fact that animal companion.
     
  19. Offline

    kalez

    Yeah it still says woof and everything else seems to be working. Maybe this is what your saying, but its like as if that part of the plugin gets unloaded from the wolf when the wolf isnt being loaded, which is proly normal, but then its not reloading with the wolf.
     
  20. Offline

    TheTennessee

    Yeah, here's what I am going to do. It sounds like the problem is, the wolf itself is becoming somehow different than the one you are looking at, because it was unloaded. I am going to make it so that the wolf is linked every time you right click on it, not just when it isn't already linked, that way if it is the former rather than latter, it will relink and hopefully work.
     
  21. Offline

    kalez

    That sounds like a plausible solution. you think all that extra linking will cause lag?

    EDIT: would it be possible to make something like a "/ac mode [mode] [name]" command? cause ive been chased by mobs and unabled to change my dogs mode cause i couldnt reach them :p
     
  22. Offline

    TheTennessee

    It shouldn't. Honestly, it's just setting a single variable. In fact it might work better, since I am no longer checking that variable anymore.

    And what do you mean mode? AI type? use /ac ai [name] [aitype]

    Anyhow, I made an update, should work better. I just have to up the change log in a moment. If I didn't get to someone's issue, that was because I didn't have enough information to fix it. Please bare with me on this stuff. Wolves love to change their data, and I am slowly finding all the instances where they do that.

    Yep, oh, and I tested PvP protection in my server and couldn't find any way for another player to damage the wolf outside of burning it or something, and I couldn't get my wolf to attack it either, even with the leash item. So, I'd have to see more about this error before I could replicate it and test it.

    Alright, yeah, I'll try to make it more automatic in the future as I find more elegant solutions, but at least I've eliminated the need for a server restart now. ^_^

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: May 18, 2016
  23. Offline

    kalez

    Sweet! its all working now, even if i fly way far out and tp the wolf! At least so far with the hellhound. Ill keep testing it.

    Edit: Ok so it works, but as you said, only if you right click on it. If i have him on a AI like hunter , leaving him standing, and log out or it is unloaded too long, it will still be growling when i come back, but doesnt attack until i right click.

    Edit2: Well i had the pvp protection on, and he just walked up with a diamond sword and was able to hit it, cause i told him to try, thinking it would be protected lol. there wasnt really anything else to it.
     
  24. Offline

    TheTennessee

    Hm... was it the PvP protection in the server? Like... server.properties? PvP protection means that in a server where PvP is disabled, it also protects the wolves. If PvP is enabled, then the wolves are attackable by anyone but yourself.
     
  25. Offline

    Sepulzera

    There seems to be some compatibility-issues in the new ac version with the plugin "CustomDifficulty".
    If i want to register a new wolf...i get the message: "Cannot. No permissions or too many wolves registered".

    Thought its working perfectly with an old ac version or without customdifficulty.


    Edit: With customdifficulty its possible to manipulate the damage. Maybe you should take some closer look at this plugin :p
     
  26. Offline

    TheTennessee

    Is that the actual message or a paraphrase? You put it in quotes, so I am a little confused. That message isn't part of my plugin as written, so I am not sure where it is coming from. If it is just a paraphrase, go into the AnimalCompanion folder, locate your name, and look to see how many wolves are saved there. It might be that there are a few ghosting files in there you need to delete.

    I will look into Custom Difficulty as well. I will see if they figured out how to solve the issue without creating more of them. I used sRPG for the same thing, and it doesn't work right now.
     
  27. Offline

    Sepulzera

    Just put quotes to mark the message ... ^^
    The real message is...


    I deleted the whole folder when upgrading it, to prevent such issues.
    But it shouldnt occur aswell, as the admin has the permission "animalcompanion.infinitewolves"



    Btw: Its working with CustomDifficulty, but only when i don't use any "difficulty-file".

    EDIT: Forget the crap I wrote here.
    Addind a difficulty-file in the config of CustomDifficulty will lead to this issue.
     
  28. Offline

    TheTennessee

    Interesting... well, I know a friend who is using the plugin, I'll see if I can test over there. I am not sure what would cause that, but I do know that I added the registration checking in the latest update, so it could have existed before then but not shown up. Does this also happen when you tame a wild wolf, or only when you try to register?
     
  29. Offline

    Sepulzera

    I can tame wolves, but can't register them as companions.
     
  30. Offline

    TheTennessee

    Alright, and what is your wolf cap set to currently? And how many do you have total at this time?
     
  31. Offline

    Sepulzera

    Cap: 3
    Current: 0

    I'm confused, as I have permission + didn't reach the max ... plus customdifficulty doesn't change anything there....well
    maybe the plugin doesn't have permission, mean maybe its blocked by customdifficulty, as it tries to manipulate wolves-stuff too? oO
     

Share This Page