Inactive [FUN/MECH]MobCatcher v3.0.1 - Capture mobs and get spawn eggs legitimately[1.4.2-R0.2]

Discussion in 'Inactive/Unsupported Plugins' started by Malikk, Jan 30, 2012.

  1. Offline

    Malikk

    MobCatcher - Capture mobs and get eggs legitimately:
    Version: v3.0.1
    [​IMG]
    Developed by Malikk.
    Contributions from Arzeyt.

    Moved to BukkitDev

    This plugin allows players to capture all types of mobs with eggs and get the corresponding spawn egg. This allows for many things; such as the easy trading and transporting of peaceful mobs and capturing monsters to release later without the use of creative mode.

    BukkitDev - Download MobCatcher.jar

    Features:
    • Capturing configurable mob types
    • Saving and Recalling mob data for specific spawn eggs (color, age, tamed, etc.)
    • Spout Custom spawn eggs
    • Getting spawn eggs without creative mode
    • Configurable capture item, including projectiles
    • Configurable costs for every mob type
    • Sign-based mob protection system
    • Vault Economy Cost support
    • Percent Chance to catch mobs
    • Doesn't interfere with players in creative mode
    v3.1 Video Preview

    Additional Videos

    Usage:
    • All you have to do is (after making sure you have the right materials, which is by default 5 redstone dust) hold an egg (configurable) and left click on the mob you wish to capture.
    Sign-based Mob Protection (open)


    MobCatcher now offers a Sign-based mob protection system!

    This feature will allow you to keep your mobs safe. Within the radius of your sign, you are the only one who can capture mobs.

    To Create a MobCatcher Sign:
    Line 1: mobcatcher
    Line 2: whatever you want to name the area
    Line 3: radius (only if PlayerSet is enabled, otherwise leave blank)
    Line 4: Blank
    [​IMG]


    It will then create a sign that looks like this.
    Line 3 is the player who owns the area.
    Line 4 is the radius the sign is effective for.
    [​IMG]



    Commands:
    • /mobc - Displays all command usage
    • /mobc item - Displays Capture item setting
    • /mobc projectiles - Displays projectile settings
    • /mobc settings [mobtype] - Displays current settings
    • /mobc worlds - Displays which worlds MobCatcher is enabled in
    • /mobc area - Returns how many signs the player is within the radius of
    • /mobc resetsigndata - deletes all sign data
    • /mobc reload - reloads the config file
    Please leave feedback! I want to know what you all think and how I can improve this plugin. Help me help you :)

    Todo:
    • Make suggestions below!
    Known Bugs:
    • None, please post if found
    Changelog:

    Version 3.0.1
    • Fixed bug: Only OPs can catch bats
    Version 3.0
    • Updated to CB 1.4.2-R0.2
    • New: Support for Witches, Bats, Wither Skeletons, and the Wither Boss
    • New: Mob data ids are now written to the itemStack's nbt tag (no more enchantments)
    • New: Eggs used while in creative mode now recall mob data
    • Fixed bug: dupe bug with ShowcaseStandalone (and probably other plugins as well)
    • Fixed bug: Spawn eggs should not be used on clicks against anvils and beacons
    • Fixed bug: Enderdragon takes peaceful mob costs in simple config setup
    • Known bug: mobs that use weapons do not attack players after having their weapons set (all of them spawned by mobcatcher). This is not a mobcatcher bug.
    Version 3.0 Dev
    • New: Completely new permissions system
    • New: /mobc clean command to remove data from an egg
    • New: Added config option to disable permission denial messages
    • New: Metrics graph to see who is using the Spout features
    • Fixed bug: duplication bug for spawn egg clicks against ender chests, jukeboxes, and any modded in blocks
    • Fixed bug: minor blockPhysics error
    • Fixed bug: possible inappropriate damage cancellation
    • Fixed bug: item costs now work for amounts exceeding 64
    Older Changelog (open)

    Version 2.19.1
    • Fixed bug: Spawn eggs do not work at all in disabled worlds
    • Fixed bug: Wolves do not fall under either the peaceful or hostile permission nodes
    • Fixed bug: Various bugs with disabled worlds
    Version 2.19
    • New: Spawn locations for both direct click and thrown captures are now MUCH more accurate.
    • Removed: Teleporting mobs out of blocks after spawning them, no longer needed.
    • Fixed bug: Players and mobs do not suffocate
    • Fixed bug: Only farmer villagers spawn from eggs with no data, now it randomizes like normal MC 1.3.1
    • Fixed bug: Baby villagers dont spawn from breeding
    • Fixed bug: On item scroll over, creepers are incorrectly labeled as supercharged
    • Fixed bug: If durability for the capture item is not specified, it always checks for durability of 0. Meaning tools, weapons, etc. cant be used to capture once they don't have full durability.
    Version 2.18.1
    • Fixed bug: Spawn eggs spawn 2 villagers (due to a bukkit bug, fixed via a work around)
    Version 2.18
    • New: Spout Custom eggs now work for non-Spout client users (no texture or item name)
    • New: Config option to disable Spout features (Custom eggs will be rendered useless once disabled)
    • New: Mob Data now saves whether or not Pigs are saddled
    • New: Plugin now works for servers with AND without Spout
    • New: No longer says which player used to own a tamed mob
    • Fixed bug: Vault no longer causes start up errors for Spout-enabled servers
    • Updated for 1.3.1, should still work with 1.2.5
    Version 2.17 Spout
    • New: Spout custom items for SnowGolem, IronGolem, Enderdragon, Tamed Wolf, and Cat eggs
    • New: Permission for overriding Protection Sign Limit
    • Fixed bug: Multiple capture items are taken for projectile captures.
    NOTE: This build is only compatible with servers using Spout. An update will be released soon so that it works with and without Spout.

    Version 2.16 DEV
    • New: Mob data now saves the mobs health
    • New: Capturing mobs no longer damages them
    • New: Item data values can now be specified (for costs and the capture item) with either a ";" or ":"
    • Fixed bug: Insufficient cost message and capture cancellation for costs with amounts of 0
    • Fixed bug: NPE on blockPhysics (in some rare, unpredictable circumstances)
    • Fixed bug: Spawn eggs thrown while other spawn eggs spawns are still pending always spawn default mobs
    NOTE: I am releasing this version under the pretense that it is a DEV build. All of the major mechanics are working, but due to a lot of rewriting some minor things may be buggy. I simply don't have the time or man power to test ALL of the config options and everything to make sure it still works after this rewrite. I would HIGHLY appreciate it if people would use this version and make tickets so that I can fix all the small things.

    Version 2.15
    • Added option to specify item data values for both the capture item and costs (separate with ; )
    • Added plugin metrics
    • Fixed /mobc reload
    Version 2.14
    • Updated for 1.2.5-R3.0
    • Updated Enderdragon code
    • Added /mobc reload command
    Version 2.13.3
    • Fixed spelling mistake which broke some config settings for the Silverfish
    Version 2.13.2
    • Really fixed bug: conflict with player interact. Is now NOT CANCELABLE by other plugins, unless you ask me the special way how, lol
    Version 2.13.1 (removed)
    • Fixed bug: conflict with other plugins on PlayerInteract
    Version 2.13 (removed)
    • Added proper event cancellation to player interact, via a bukkit bug work around
    • Added permission nodes for the remaining peaceful mobs
    • Added config option to make mobs spawned from mob spawners uncapturable (OP override)
    Version 2.12.1
    • Fixed bug with dispenser captures
    Version 2.12
    • Fixed bugs with sheep and tamed mob data saving incorrectly
    • Added config option to turn off mob data entirely and return egg stackability to normal
    • Added config options for dispensers to be able to both spawn (shoot) and capture mobs (default false)
    • Added correct 'must be killed' checks for angry wolves, ocelots, snow golems, iron golems, and Enderdragons
    Version 2.11
    • Added permission nodes for wolves, ocelots, and villagers
    Version 2.10
    • Added ReturnedOnSpawn for thrown spawn eggs
    • Added mobcatcher.can-catch (default true)
    • Completely separated wolves and angry wolves
    • Fixed bug: MissedEggsSpawnChickens now works correctly
    • Fixed bug: Egg dupe glitch involving interactive signs from other plugins (probably)
    Version 2.9
    • Fixed a bug which allowed you to get multiple spawn eggs from a single mob by clicking fast enough
    • Fixed a bug in 2.8 which broke projectile captures for eggs and snowballs
    • Fixed a bug caused by Async tasks, thanks to NoLagg
    Version 2.8
    • Spawn eggs can now be shot (with actual velocity) out of dispensers
    • Added config options for enableing and adjusting the power of spawn eggs in dispensers
    • If the EntityDamageEvent is cancelled by another plugin, mobs cannot be captured either (Towny, other mob protection, etc.)
    Version 2.7
    • Must be using CB #2093 or later to update
    • Added support for Villager ages
    • Added option to stop Iron Golems from targeting players after capturing Villagers
    • Minor code clean ups
    Version 2.6.2a
    • Incorporates MOST of the features of v2.6.2, but is compatible with recommended build 1.1-r6
    • Only for use with 1.1-r6, for 1.2.3-RO.3 servers use regular v2.6.2
    Version 2.6.2
    • Fixed bugs for non-living entities
    • 'Fixed' spawn eggs so that they can now spawn non-living entities
    • Minor changes to player messages
    • Only necessary to update if you have some hackish way to get these spawn eggs
    Version 2.6.1
    • Fixed sound effect bug (constantly being triggered by another plugin)
    • It is only necessary to update if you were experiencing this issue
    Version 2.6
    • Bug fix: Thrown spawn eggs can no longer be picked up before they spawn (dropped ones still can)
    • Added permissions and config options for thrown spawn eggs
    • Capture and Spawn messages can now be disabled in the config
    • Failure messages are now only shown once for consecutive hits on the same mob
    Version 2.5.1
    • Fixed CreatureSpawnEvent error (only conflicted if another plugin spawned mobs in a similar way)
    Version 2.5 (and unreleased 2.4)
    • Spawn eggs are now throwable
    • Cats and Wolves now spawn tamed to the player who spawned them, not the original owner
    • Cats and Wolves now spawn standing
    • Added more permissions
    • Egg IDs are now removed from the database upon item despawn
    • Made databases more efficient
    • Minor changes in sign messages
    • Bug fix: Villager data is now removed after spawning
    • Bug fix: When checking if a placed sign overlaps another players sign, it no longer checks the location of the sign, but the actual radius of the sign so that signs radii cannot overlap.
    • Bug fix: The capture item can now do damage to other players
    • Removed entity target event until it is fixed for Iron Golems
    Version 2.3.1
    • Fixed incorrect build with v2.3
    • Fixed item scroll messages for new spawn egg enchantments
    Version 2.3a
    • Incorporates MOST changes since v2.1, but is compatible with recommended build 1.1-r6
    • Only for use with 1.1-r6, for 1.2.3-RO.1+ servers use regular v2.3
    Version 2.3
    • Fixed enchantment bug with spawn eggs (old eggs will still work, new ones will no longer be glitchy)
    Version 2.2.1
    • Fixed Enderdragon bug
    Version 2.2
    Breaking Changes in mobData.dat file. Please shut off server and delete or the plugin WILL NOT WORK.
    • Rewrote datafile to save via specific eggs, rather than by players
    • Removed stackability of spawn eggs
    • Removed resetMobData commands
    • Added /mobc settings [mob] command
    • Added messages on item switch
    • Updated for 1.2.3
    • Updated Command List
    • Added max radius for sign protection
    • Fixed messages for permissions on resetSignData command
    • Added support for Ocelots, Cats, Iron Golems, Snow Golems, and Enderdragons
    Version 2.1
    • Added support for Powered Creepers
    • Data is no longer saved for failed captures
    • Completely rewrote config (simple and complex setups)
    Version 2.0
    • Added .dat file to save and recall mob data
    • Added /mobc resetmobdata command
    • Added a limit to the number of signs a single user can place
    • Added more permissions
    • Fixed various bugs with sign protection
    • Fixed bugs for servers using both vault and item costs
    Version 1.12
    • Removed messages if the target was another player
    • Rewrote command system
    • Added commands /mobc projectile, /mobc resetsigndata
    • Separated MustBeKilled for Peaceful and Hostile
    Version 1.11
    • Added support for Projectiles (egg, snowball, and arrow)
    • Added (config) chicken eggs no longer spawn chickens
    • Added more Sign permissions
    • Added option to disabled direct capturing (i.e. projectiles only)
    • Added Effects to captures
    Version 1.10
    • minor bug fixes
    • Added individual radii per sign
    • Players now cannot break other players signs
    • Physics events can no longer break signs
    • Added /mobcarea command
    • Added permissions for signs
    Version 1.9
    • Added Sign-based Protection system
    Version 1.8.1
    • Added new permission for 'Free' captures
    • Fixed MAJOR bug causing the plugin to fail to load
    Version 1.8
    • Added Vault Economy support
    • Added new commands /mobc, /mobcitem, /mobcitemcost, /mobcvault
    • Fixed Itemstack bug
    • Added Sheared Sheep capture configuration
    Version 1.7
    • Added multi world support
    • Added /mobcworlds command
    • Added Capture Chances
    • Removed conflict with sign-based plugins
    Version 1.6
    • Added Permissions support
    • Added 'Mobs must be killed" option
    • Added option to get back Capture item after spawning a mob
    • Added /mobcinfo command
    Version 1.5
    • Added separate configurable costs to peaceful and hostile mobs
    • Baby animals are now uncapturable (config)
    Version 1.4
    • Spawn eggs can now be picked up off the ground
    • Eggs are no longer removed when right-clicking on beds, workbenches, etc.
    Version 1.3
    • Major bug fix
      • clicks on "air blocks" no longer remove spawn eggs
    • No longer interferes with players in creative mode
    • added spawn messages
    Version 1.2
    • fixed left-click Spawn egg remove glitch
    • minor bug fixes
    Version 1.1
    • made the capture item configurable
    Version 1.0
    • Initial release
     
    TienSon and nicholasntp like this.
  2. Offline

    h0us3cat

    lol you stole my idea.
    source?
     
  3. Offline

    Malikk

    h0us3cat I didn't upload it because i didn't want it to get stolen, lmao
     
  4. Offline

    jinS

    ~ awesome
     
  5. Offline

    h0us3cat

    Malikk

    Can you add a option for left click or right click?
     
  6. Offline

    Arzeyt

    Right clicking while holding an egg would make you throw it. Are you suggesting that you would rather have it capture mobs by the egg hitting the mob, or would you rather have it right click at close range? The mechanics would be a bit different for each of these options.
     
  7. Offline

    h0us3cat

    Keep the throw egg function, but if target is mob cancel throw event and start your plugin?
    So yeah only on close range right click.
     
  8. Offline

    Malikk

    h0us3cat I'm not sure what you're asking for. What's the point of switching from a left click to a right click if you're still doing everything close-range? Sure, you'll hit the mob, but they're immediately despawned. As long as you don't set your capture item to a diamond sword, everything should be fine, lol.

    @md_5
    Not trying to be impatient, but I've seen your name before. Would you mind taking a look at this? Everything should be in order.

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

    h0us3cat

    If you look how other items work, its always right click to do something like that. Like open chests, furnaces etc.
    It feels more logical then right click and not left click.
     
  10. Offline

    Malikk

    h0us3cat but since all those other right clicks already trigger different events it would be very impractical to cancel all those. Plus, with a left click, the mob gets damaged a little bit, I think its nice to see them react before they're captured, rather than just disappear.

    For the right click, say you were using the default egg, you would be throwing eggs everywhere, and then I would have to cancel them? It would look weird, likely they would still shoot a few yards then disappear. That doesn't really make any sense, either logically or in respect to the way id have to program it.

    I generally would love to add suggested content to any of my plugins, but with this idea I'm going to have to respectfully decline. Feel free to suggest anything else.
     
  11. Offline

    Malikk

    My bukkitDev page got approved, but I still cant get out of the plugin submissions forum here, lol
     
  12. Offline

    md_5

    Some mornings I click the alerts but then don't get time to do anything about them.
    You can always spam me with tags :p
    Approved
     
  13. Offline

    macweirdo

    Can you post your source? I would like to make some modifications to your code (and, of course, I won't redistribute the newly modified plugin or your source)

    Also, if you're afraid of it being stolen, can you PM it to me?
     
  14. Offline

    Malikk

    macweirdo what are you wanting to change?
     
  15. Offline

    macweirdo

    Malikk I want to make it so you have to kill the monster with a golden sword.
    I already was working on something like that, so I have code prepared.
    I could do this in just a copy-and-paste.
     
  16. Offline

    Malikk

    macweirdo Thats already in my plugin. Just open up the config file and change the id of the CaptureItem to golden sword. Should be good to go.

    EDIT: and change UsedOnCapture to false
     
  17. add permissions and ill go for it
     
  18. Offline

    Malikk

    Working on it now. Should the permissions be applied to just capturing? or spawning as well?

    open to anybody
     
  19. Offline

    laurixas7777

    could you make it possible to make that after you spawn captured mob from egg you get simple egg back so you can use it again and how can i make that free to do without redstone dust. Then i can make pokemon style server with difficult to get unless buying egg "pokeballs" :)
     
  20. Offline

    macweirdo

    Malikk thanks, but I want to actually force the player to _kill_ the creeper with the golden sword.

    Code:
    @EventHandler
    public void Death(EntityDeathEvent event) {
            if (event.getEntity().getLastDamageCause() instanceof EntityDamageByEntityEvent) {
                EntityDamageByEntityEvent next = (EntityDamageByEntityEvent) event.getEntity().getLastDamageCause();
                if (next.getDamager() instanceof Player) {
                    Player playerinvolved = (Player) next.getDamager();
                    if (playerinvolved.getItemInHand().getType()==Material.GOLD_SWORD) {
                        Entity entity = event.getEntity();
                        event.setDroppedExp(0);
                        ItemStack finalkillstuff=null;
                        finalkillstuff.setTypeId(383);
                        List<ItemStack> items=event.getDrops();
                        List<ItemStack> itemsback = items;
                        items.clear();
                        //items=itemsback;
                        //try to instanceof EVERYTHING
                        //if(entity instanceof Zombie){finalkillstuff}
                        //if(items != itemsback){items.add(finalkillstuff);}
                     
                    }
                }
            }
        }
    That's what I currently have. This would make a mess if you added it to your code, because then you would test for two events, and I believe that would be really sloppy-looking.

    This is why I like open source code. You can make all the modifications you want without depending on the author of the plugin to approve them, as long as you don't claim it's yours in open source. Don't like the way Shift-selection works in LibreOffice? Change it, I say.
     
  21. both, cuz i want common users to be able to spawn mobs, but i dont want em to catch, i juas want premiums be able to catch
     
  22. Offline

    Malikk

    Thats how its setup now, by default, everybody can spawn them, the idea being, if they've been able to acquire an egg, they should be able to use it. Likely, if they dont have capture permissions, they dont have spawn eggs. So, theres not actually nodes for spawning, but its setup the way you want it. Theres already a crapload of nodes, so I dont really wanna add anymore at the risk of everything getting incredibly confusing.

    Yeah, i can definitely work that in to the next version, should be easy. Thanks for the suggestion

    EDIT: I just added a new page on this plugins bukkitdev about the config file, in depth. Check it out.

    macweirdo I would give you my source, but I feel like its something that the official plugin should have anyways so I went ahead and added that feature myself. None of your code tho. I set it up so that based on the config, only one or the other of the two events are triggered, and then passed in the player and entity variables as parameters to the main method. So, its just as clean, but incorporates your idea. Thanks for the suggestion.

    The new version should be up tonight, as soon as I finish testing the permissions nodes

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

    dandaman1001

    This is just like a pokeball. Lol
     
    Malikk likes this.
  24. Offline

    Malikk

    Yeah, lol. That didnt even cross my mind until a couple people have mentioned it that way. Seems so obvious, lmao
     
  25. im still requesting: Permissions for this.
    Permissions to make an egg :) I dont want players to be able to create creeper eggs and destroy ppls houses D:
     
  26. Offline

    Build-O-Tron

    Not sure what I'm doing wrong with this plugin.
    I Installed it and am using the default config. Using the latest version (1.8.1)
    Whenever I left click (With any items) I get this error in the server console (Sorry for the no spoiler button, I cannot figure for the life of me how to make them).

    [SEVERE] Could not pass event org.bukkit.event.player.PlayerInteractEvent to MobCatcher
    org.bukkit.event.EventException
    at org.bukkit.plugin.java.JavaPluginLoader$103.execute(JavaPluginLoader.java:1026)
    at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:57)
    at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:453)
    at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:187)
    at net.minecraft.server.ItemInWorldManager.dig(ItemInWorldManager.java:95)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:510)
    at net.minecraft.server.Packet14BlockDig.handle(SourceFile:43)
    at net.minecraft.server.NetworkManager.b(NetworkManager.java:226)
    at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:100)
    at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:78)
    at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:543)
    at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:441)
    at net.minecraft.server.ThreadServerApplication.run(SourceFile:465)
    Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    at org.bukkit.plugin.java.JavaPluginLoader$103.execute(JavaPluginLoader.java:1024)
    ... 12 more
    Caused by: java.lang.NoSuchFieldError: MONSTER_EGG
    at me.jordan.mobcatcher.MCSpawnEvent.onPlayerInteractEvent(MCSpawnEvent.java:35)

    Any idea ?
     
  27. Offline

    Malikk

    There should already be permissions for that.
    Check out the page on my BukkitDev :)
    http://dev.bukkit.org/server-mods/mobcatcher/pages/permissions-nodes/

    [spolier="<name>"][/spoiler] :)

    I can't seem to duplicate your error. Maybe you have more than one version of MobCatcher running? I'm looking into it, but I'm not sure at the moment.

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

    Build-O-Tron

    I can't seem to duplicate your error. Maybe you have more than one version of MobCatcher running? I'm looking into it, but I'm not sure at the moment.[/quote]


    Thanks for the spoiler help :)
    For the error, I just installed it, so no previous version were installed.
    I guess I'll work from a clean server and add the other plugins one at a time.
     
  29. Offline

    Malikk

    Build-O-Tron
    What version of Bukkit is your server running? I've not tested this plugin with anything prior to 1.1-R1
     
  30. Offline

    Cyris69

    I can't get it to use iConomy, Vault is enabled, I made not other changes to the config but it will not use an egg or take money. Unless everything is free for admins?
     

Share This Page