Inventory Drop Chance
Inventory Drop Chance
Version: v1.6
(Follow me on Twitter for updates!)
Inventory Drop Chance is a plugin created by Staartvin from a request by DerekZil.
Do you want to your server to be a little more RPG-ish? Are people frustrated by losing items on death?
Well, then Inventory Drop Chance (IDC for short) is something for you! IDC allows admins to set a percentage of retained items on death. The retain percentage is configurable. When a player dies, x% of his/her inventory will be given back. The items that are not given back are dropped on the ground. All items get chosen randomly. This is to prevent players from cheating. You can also specify a delete percentage. IDC will then remove a percentage of the inventory (Those items aren't dropped nor given back). IDC also has custom WorldGuard flags that can be used. These flags are: 'xploss-percentage', 'retain-percentage' and 'delete-percentage'. You can also setup blacklisted or whitelist items. In short, this plugin is super customisable.
Features:
- Can give players x% of their dropped items back.
- Can delete a percentage of their inventory on death.
- Very lightweight
- Extremely simple
- Drop and play
- Permissions
- Multiworld support
- Group based (Example: Give a donor rank 20% loss, but a noob group 100% loss)
- WorldGuard integration (Custom flags 'retain-percentage' and 'delete-percentage')
- Whitelist and blacklists (Some items will always be dropped, some are always kept)
- Automatic version checking
Permissions:
- - idc.group.<groupname> A player with this permission is bound to a group. All percentages are based on a group. If a player hasn't got this permission, it will lose all their xp and items. Just like vanilla Minecraft.
- -idc.keepallitems A player with this permission will retain all of his items when (s)he dies.
- -idc.keepxp A player with this permission will keep all their xp.
- -idc.noticeonupdate A player with this permission will get noticed when a new version of IDC is available.
Commands:
- None yet
Pictures:
Messages shown when a player respawns
Donations
I'm a poor student and I'm developing this plugin in my free-time, if you like my plugin and want to help me, please donate. Donating is the best way to help me out, it goes towards more bug-fixing. Thanks! Donate is in the top right corner. ;)
Donators
Thanks to all the people who donated and downloaded this plugin! I love you all! <3 Especially thanks to my donators who gave me that little boost:
- WayGroovy with 5 dollars
- RsmKaelub with 10 dollars
- deathhzone with 5 dollars
WOW. WARN AGAIN!
2013-08-25 13:26:01 [SEVERE] Could not pass event PlayerRespawnEvent to InventoryDropChance v1.5 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463) at com.earth2me.essentials.Teleport.respawnNow(Teleport.java:202) at com.earth2me.essentials.Teleport.respawn(Teleport.java:174) at com.earth2me.essentials.commands.Commandhome.run(Commandhome.java:67) at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:135) at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:505) at com.earth2me.essentials.Essentials.onCommand(Essentials.java:372) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:192) at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchCommand(CraftServer.java:527) at net.minecraft.server.v1_6_R2.PlayerConnection.handleCommand(PlayerConnection.java:979) at net.minecraft.server.v1_6_R2.PlayerConnection.chat(PlayerConnection.java:890) at org.bukkit.craftbukkit.v1_6_R2.entity.CraftPlayer.chat(CraftPlayer.java:241) at cz.boosik.boosCooldown.BoosWarmUpTimer$boosWarmUpRunnable.run(BoosWarmUpTimer.java:66) at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftTask.run(CraftTask.java:58) at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:518) at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:239) at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:481) at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:413) at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582) Caused by: java.lang.NullPointerException at staartvin.inventorydropchance.Methods.returnItems(Methods.java:190) at staartvin.inventorydropchance.listeners.IDCListeners.onPlayerRespawn(IDCListeners.java:184) at sun.reflect.GeneratedMethodAccessor481.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ... 24 more
@CommodoreAlpha
Yes, he's one hundred percent correct.
@deathhzone
To find out whether or not IDC is the culprit, you can run a testing server (on your home computer) with only IDC in it. You should try to imitate the scenarios where players die and drop the incorrect amount of experience, and if you can replicate the results, the culprit is most definitely IDC.
However, I do realise this may not be possible to do - for a number of reasons - but I just wanted to give you a helpful pointer. Seeing as this is a more critical issue for your server, you should take action whenever you can to get closer in solving or at least remedying the issue, and this is one of those actions you can try to take.
@Staartvin
Is there a possibility of looking into this? It's kind of a large issue, as players can simply kill themselves and gather hundreds of levels without the slightest of effort. If it isn't caused by IDC I apologize for bothering you, but you can imagine how this could affect my server.
@Staartvinea
i don't know but after this error my server crashed. Anyways, your plugin is great.
@lanceryy
When did this error occur?
v1.5 bug!
2013-08-23 12:55:25 [SEVERE] Could not pass event PlayerRespawnEvent to InventoryDropChance v1.5 org.bukkit.event.EventException at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:427) at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62) at org.bukkit.plugin.TimedRegisteredListener.callEvent(TimedRegisteredListener.java:30) at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:478) at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:463) at com.earth2me.essentials.Teleport.respawnNow(Teleport.java:209) at com.earth2me.essentials.Teleport.respawn(Teleport.java:181) at com.earth2me.essentials.commands.Commandhome.run(Commandhome.java:67) at com.earth2me.essentials.commands.EssentialsCommand.run(EssentialsCommand.java:135) at com.earth2me.essentials.Essentials.onCommandEssentials(Essentials.java:470) at com.earth2me.essentials.Essentials.onCommand(Essentials.java:337) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:44) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:192) at org.bukkit.craftbukkit.v1_6_R2.CraftServer.dispatchCommand(CraftServer.java:527) at net.minecraft.server.v1_6_R2.PlayerConnection.handleCommand(PlayerConnection.java:979) at net.minecraft.server.v1_6_R2.PlayerConnection.chat(PlayerConnection.java:890) at org.bukkit.craftbukkit.v1_6_R2.entity.CraftPlayer.chat(CraftPlayer.java:241) at cz.boosik.boosCooldown.BoosWarmUpTimer$boosWarmUpRunnable.run(BoosWarmUpTimer.java:66) at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftTask.run(CraftTask.java:58) at org.bukkit.craftbukkit.v1_6_R2.scheduler.CraftScheduler.mainThreadHeartbeat(CraftScheduler.java:345) at net.minecraft.server.v1_6_R2.MinecraftServer.t(MinecraftServer.java:518) at net.minecraft.server.v1_6_R2.DedicatedServer.t(DedicatedServer.java:239) at net.minecraft.server.v1_6_R2.MinecraftServer.s(MinecraftServer.java:481) at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:413) at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582) Caused by: java.lang.NullPointerException at staartvin.inventorydropchance.Methods.returnItems(Methods.java:190) at staartvin.inventorydropchance.listeners.IDCListeners.onPlayerRespawn(IDCListeners.java:184) at sun.reflect.GeneratedMethodAccessor514.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:425) ... 24 more
@devonson4
Check your server.log for errors with IDC.
@shadvalentine
Okay, good luck!
@deathhzone
Well, in theory this could be caused by IDC. I have no idea why though.
@Staartvin
it will be a few days before I can remove WGRegionCommands as it is a major part of my games world .. but I will try to get the test server up and test it there
Hey, whenever I install the plugin, on my plugin list the plugin is coloured red, and when I do any commands within the plugin, it outputs 'Error occurred'. I have worldguard. I wonder if there are any plugins that enflict, or I need anymore plugins..
I'm not sure if i've asked about this before, but occasionally when players die, they'll lets say die with 6 levels of XP, and where they died, they'll have dropped 73 levels, or any random insane amount of levels, could this plugin POSSIBLY cause that, because no one has ever heard of this glitch that I've spoken to, and I don't know what could be causing it.
@shadvalentine
It could be. It's something in the code of WGCustomFlags that isn't working.
You should try and remove the other WGPlugins and see what happens.
this has to do with the custom flag (as I am sure you see in the error) and it is not adding the retain-percentage and delete-percentage flags .. I did not have any errors until I installed WGCustomFlags
wondering if it may be a conflict with WGRegionEvents or WGRegionCommands
@shadvalentine
Hmm, that's odd. There shouldn't be any problems...
I am getting an error...
2013-08-19 20:29:18 [INFO] Added custom flag "xploss-percentage" to WorldGuard.
2013-08-19 20:29:18 [SEVERE] Error occurred while enabling InventoryDropChance v1.4.3 (Is it up to date?)
java.lang.NullPointerException
at com.mewin.WGCustomFlags.FlagManager.addCustomFlag(FlagManager.java:76)
at com.mewin.WGCustomFlags.WGCustomFlagsPlugin.addCustomFlag(WGCustomFlagsPlugin.java:246)
at Staartvin.InventoryDropChance.WorldGuardHandler.registerFlags(WorldGuardHandler.java:33)
at Staartvin.InventoryDropChance.InventoryDropChance.onEnable(InventoryDropChance.java:46)
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217)
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:457)
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.loadPlugin(CraftServer.java:282)
at org.bukkit.craftbukkit.v1_6_R2.CraftServer.enablePlugins(CraftServer.java:264)
at net.minecraft.server.v1_6_R2.MinecraftServer.l(MinecraftServer.java:313)
at net.minecraft.server.v1_6_R2.MinecraftServer.f(MinecraftServer.java:290)
at net.minecraft.server.v1_6_R2.MinecraftServer.a(MinecraftServer.java:250)
at net.minecraft.server.v1_6_R2.DedicatedServer.init(DedicatedServer.java:151)
at net.minecraft.server.v1_6_R2.MinecraftServer.run(MinecraftServer.java:391)
at net.minecraft.server.v1_6_R2.ThreadServerApplication.run(SourceFile:582)
@HammerHedd
Hmm, this is really odd. I'm going to put a debug version online. You should download it and give me the results ;)
EDIT: before you try this, try v1.5 first. (when it is available) I fixed some issues concerning 100% retain percentages.
I"m having a similar problem:
Craftbukkit 2838, PEX 1.19.6, IDC 1.4.3
When I die in any group, my inventory (but not my item slots 1-9) disappears. Not dropped, just deleted (my delete settings are 0, drop chance 50). In a group which should retain all items, I get the message that I "retain all items" but I don't. In a group where I should be dropping 50%, the same thing happens. If I take out IDC, the behavior is normal minecraft (i.e. drop everything), so I don't >think< any other plugins are glitching this. I do have multi plugins like craftbook and essentials (yes, both).
@Abdulkawi
Hopefully tomorrow.
@deathhzone
Try to do the test again but as a normal player. Don't be in the owner/admin group but just a regular player group. The asterisk could cause problems as well as inheriting. If it still doesn't work: Could you make a video showing the exact scenario? It helps me debugging.