Loot
Requirements:
- KBPL
- If the version in the title is higher than the one on the 'recent files' list, then you will have to wait until bukkit approves the latest version since KBPL could be updated and have code that does not work with previous versions of the plugin.
What it does:
The title pretty much says it all! But to be a bit more detailed, Loot makes it easy to create chests with randomly generated loot. The best part? No commands. Oh did I mention that it adds random enchantments to armor and weapons and can spawn random potions? Yeah, that too. Its the perfect loot generator for custom dungeons and worlds with randomly generated schematics.
Features:
- Automatic Chest Regeneration Refills chests automatically using a list of items that you configure.
- Enchantments You can configure whether loot chests will spawn items with random enchantments, or you can specify the enchantments yourself.
- Potion Effects Same as the enchantments, but with potions.
- Item naming Specify a name for the items spawned in a chest! You can also configure the plugin to let it add a random preffix/suffix to enchanted items, dependent of the enchantments applied.
- Lore Add lore to any item for that true rpg feel!
- Books You can set the title, author and text of books generated!
- Colors You can set the colors of the names/lore/whatever of each item.
- Randomness A lot of the properties of any item can be randomized, including the enchantments applied, name, amount, data value, chance for it to spawn at all, etc.
- Redstone Force a chest to reset by powering the sign!
- Uses Soulbound You can download the soulbound plugin for added functionality! Visit the plugin page here.
How it works:
Important Notes:
- Requires KBPL
- The way bukkit names effects is different than the default minecraft effects, so here are some tables of the names you should use on the config file:
Enchantments
Potion Types
- You can find the color codes here.
Permissions:
- loot.sign.create - Lets you create Loot signs.
- loot.sign.break - Lets you break Loot signs.
- loot.command.name - Ability to use the command /loot name
- loot.command.reload - Ability to use the command /loot reload
- loot.list.x - Permission to open loot chests of x list
Requesting new features:
If this plugin is missing that certain special feature, bribe me and I will gladly work on it!
While I am updating and squashing bugs for free, working on new features requires time and everyone knows that time equals money.
I am however, open to suggestions that are directly related and crucial to the plugin.
Can you make it so each player has a timer and can get items from the chest? my players always say that theres nothing in them because a fast player grabbed it all and they dont see it
@ToxicShad0w
Oh I see what you mean! Well, I guess I could add that on the next update. I did however make a small update to add permission function to open certain chests, will probably show up tomorrow since it takes really long for bukkit to approve a plugin. :D
@toffster
Found the problem! You put 'wooden_sword' when it should be 'wood_sword'!
Hopefully it will work now.
I am going to make a small patch so it will indicate an item error when trying to get the material, just in case anyone else runs through this problem.
@XxkmachoxX
Alright thanks for the reply :)
Also, what I meant was a global min/max number of items(any item) forced to spawn without setting some things to 100% chance. Again, like forcing the chest to have between 4 and 6 different item stacks(They're all different items, but some have qualities, so you'd get like 3 apples, 2 snowballs, 4 iron ingots and 3 coal. That's what I mean by 4 item stacks)
And, is there a way to interact with permission plugins? So that one group can loot a chest but one group can't?
Ok I'll try that now and edit this post. Ok Just got this:
2012-08-17 16:53:33 [SEVERE] Could not pass event PlayerInteractEvent to Loot
org.bukkit.event.EventException
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:332)
at org.bukkit.plugin.RegisteredListener.callEvent(RegisteredListener.java:62)
at org.bukkit.plugin.SimplePluginManager.fireEvent(SimplePluginManager.java:477)
at org.bukkit.plugin.SimplePluginManager.callEvent(SimplePluginManager.java:462)
at org.bukkit.craftbukkit.event.CraftEventFactory.callPlayerInteractEvent(CraftEventFactory.java:177)
at net.minecraft.server.ItemInWorldManager.interact(ItemInWorldManager.java:331)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:649)
at net.minecraft.server.Packet15Place.handle(SourceFile:58)
at net.minecraft.server.NetworkManager.b(NetworkManager.java:281)
at net.minecraft.server.NetServerHandler.d(NetServerHandler.java:109)
at net.minecraft.server.ServerConnection.b(SourceFile:35)
at net.minecraft.server.DedicatedServerConnection.b(SourceFile:30)
at net.minecraft.server.MinecraftServer.q(MinecraftServer.java:583)
at net.minecraft.server.DedicatedServer.q(DedicatedServer.java:212)
at net.minecraft.server.MinecraftServer.p(MinecraftServer.java:476)
at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:408)
at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
Caused by: java.lang.NullPointerException
at org.bukkit.material.MaterialData.<init>(MaterialData.java:27)
at me.kmacho.bukkit.loot.LootListener.getMaterial(LootListener.java:346)
at me.kmacho.bukkit.loot.LootListener.getRandom(LootListener.java:283)
at me.kmacho.bukkit.loot.LootListener.getContents(LootListener.java:152)
at me.kmacho.bukkit.loot.LootListener.fillChest(LootListener.java:135)
at me.kmacho.bukkit.loot.LootListener.onPlayerInteract(LootListener.java:86)
at sun.reflect.GeneratedMethodAccessor175.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.bukkit.plugin.java.JavaPluginLoader$1.execute(JavaPluginLoader.java:330)
From the config file:
#===========================================================================#
# Name: Loot #
# Author: Kmacho #
# #
# Instructions: #
# Here is where you set up the different types of item lists. #
# I set up an example below that you can easily modify. #
# Now, onto the important stuff: #
# #
# ListName: #
# inheritance: OtherListName #
# detailed: true/false #
# #
# ListName - The name of this list(used in the second line of a sign) #
# inheritance - Will inherit the items from the list OtherListname #
# #
# detailed - Set this to true if you want to specify certain properties #
# of the items on that list. Know that this will make the config a #
# lot longer, but will enable you to customize to your liking. #
# #
# Detailed format: #
# items: #
# ItemNameOrId: #
# spawn: chance,min-max #
# effects: #
# - NameOfEffect,Min-Max Lvl,Chance,Splash,Extend #
# #
# Undetailed format: #
# items: #
# - ItemNameOrId,min-max,chance,randomEffect #
# #
# ItemNameOrId - Name or ID of the item #
# effects - Effects that could be applied to the item #
# min - Minimum amount to appear if it passes the chance check #
# max - Maximum amount to appear if it passes the chance check #
# chance - The percent chance to appear at all #
# randomEffect - add a random enchantment/potion effect(defaults to true) #
# splash - Makes the potion throwable(only applies to potions) #
# extend - Extends the duration of the effect(only applies to potions) #
# #
# You can also set up per-world loot chests. When a chest is opened and #
# does not have a loot sign under it, it checks if the world is on this #
# list. If it is, it will choose a random list of that world and be set #
# to respawn in the amout of time set on the world. #
# #
# worlds: #
# NameOfWorld: #
# time: Minutes #
# lists: #
# - NameOfList #
#===========================================================================#
common:
detailed: false
items:
- iron_sword,0,1,10,true
- wooden_sword,0,1,100,true
- leather_helmet,0,1,30,true
- leather_chestplate,0,1,30,true
- leather_leggings,0,1,30,true
- leather_boots,0,1,30,true
List of plugins on the server:
BKCommonLib
Essentials
EssentialsChat
Permissions 3
GroupManager
EssentialsProtect
NoLagg
UltraHarcore_Borders
UltraHardcore_Core
UltraHarcore_Scatter
WorldEdit
ZombieInsanity
ChestRestock
DeathTpPlus
DisableMobs
mapname attrib
Loot
Monster Apocalypse
NoCheatPlus
Random Spawn
ReasonForItAll
Thirsty
WeatherMan
I have no idea what is wrong :S My server is due for alpha next week and this is really frustrating. Bet it's something really obvious! :P
Is there a way to ensure that one player doesnt come back and continue to take the item from the chest? Such as a function that disables the item generation within the chest if the player has already opened it?
Thank you for this plugin!
@MastaC1058
I will see about fulfilling those requests :) , won't be soon though, kinda busy managing other plugins :P
@xBlueXFoxx
They regenerate loot the moment players interact with the chest. I was thinking about changing it for the next version though, so that it will change the moment it finishes cooldown. Anyways, it depends on how you set up the chests in the configuration. Unless you made at least one item have a 100% chance of spawning in a chest, it could just be that they've had really bad luck xD
@toffster
According to what I see in your configuration file, all the items in the common list only have a 20% chance to appear, so it could be that you've just had really bad rolls. Change one of them to 100% (to guarantee an item spawn), reload the server (to reset the chest cooldown) and try opening it again.
Yes it is 7 blocks below the chest. Nothing appears in the chest at all. The chat says "Created New Loot sign" as well.
I have all the chests in my world set to 15-30 minutes, a lot of people complain about chests not refilling, do they only replenish when the chests are loaded to chunk or is there some other method to how they replenish?
I must say, this plugin is so much fun. It's going great with our Factions world.
Can I make a couple feature requests?
1. Make a config option for the chest to make a server announcement when a certain list has loot generated. (Even better if you could also make it show an announcement at a time interval before the loot is generated) Think Gurubashi Arena from WoW...
2. Make loot signs toggleable by redstone.
3. Make a command to enable/disable and force-respawn loot for specific lists. Ex - /loot force arena
@toffster
Is the sign 7 blocks BELOW the chest?
it should look like this:
C
x
x
x
x
x
x
S
C = Chest
x = another block
S = Sign
@XxkmachoxX
Oh my gosh, I spent hours trying to configure it correctly thank you so much you're a lifesaver. This plugin is awesome and you are awesome, I am going to so but this plugin to work. =D
[Loot]
common
5
7
chest is 7 blocks away from sign.
@toffster
Then it has to be a problem with how you set up the sign. Write exactly what you have on the sign, in the same order of lines etc.
@Zerodagger
In the configuration, it looks like this:
world: < Just change 'world' for whatever the name of your world is.
lists:
- common
- uncommon
@XxkmachoxX
Okay, I cannot get the plugin the randomly generate the items in empty chest throughout the world for the life of me. Maybe you could give me of an example of how the layout should be. For instance my config is exactly how you left it I just need to know how/where to place the world name... yeah I know sounds dumb -_-
I done what you told me to do earlier, removed the worlds bit. But now NOTHING spawns in the chests at all.
@ToxicShad0w
Well, you can force a chest to have any quantity of anything :D
But if you mean just putting 'put x amount of any item on this chest' then no, because the way items would be generated would mean having things like the piston extension, half a door, etc.
One thing I could do though is add a function to a list to state the minimum and maximum amount of items a chest can generate in total.
About interacting with economy plugins though, I had not thought of that :O will probably add quickly tomorrow, since this should be no trouble to add at all.
@PumasCast
I have not tested it yet, but I believe this does work. Instead of using '302:125', use '302|125'
(I did it like this to avoid incompatibility issues)
Please post your results! :)
@MrMightyGnome
That would be very much appreciated! :D :megusta:
you'v been so busy recently working on this mod, im probably going to donate for your hard work :P
Is there a way to force a chest to have a set amount of items, or a range of items(Like 4-6 for example)
And can it interact with economy plugins? As in giving money