WishingWells
Introduction
WishingWells is a plugin that allows users with the "well.command" permission to create wells, and with those wells, players with the "well.use" command can drop certain items into the well, and may receive a selected list of items. All values are configurable in the config. This was originally crated for Music4lity.
Github page:
https://github.com/ZombieStriker/WishingWells_Bukkit
Permissions:
- well.use Allows a player to use the wells
- well.command Allows players to create wells/ use WishingWells commands.
Commands:
- /well create <name>: Create a new well at the player's location. Wells extends two blocks in each direction from the center of the player.
- /Well delete <name>: Deletes the well
- /Well list: Lists all the wells registered
Features:
Adds the ability to create custom wishing wells. Wishing wells are locations that players can throw per-defined items into, and based on chance values, may return a reward - an itemstack which is also per-defined by the config. All messages, rewards, and items that can be thrown into the well are configurable.
Config:
The config looks like:
#Delay between wishes in seconds
Delay: 60
Accepted:
- <item>
- GOLD_NUGGET
Returned:
# Name is a test variable, so we need to comment them out
# name:
# - <itemnumber> <amount> <meta>
test:
- DIAMOND_SWORD 1
Example:
- DIAMOND_PICKAXE 1 efficiency:1 durability:1 fortune:1 name:&4Gigadrill lore:The_drill_that_&npierces|the_heavens
ReturnedChance:
# Name is a test variable, so we need to comment them out
# name: 0
Example: 50
test: 50
CongratsMessage: '&aYou got a new item back from the well!'
TooBadMessage: '&cOh no! You lost your item in the well. Too bad!'
ItemNotAccepted: '&4That item isnt accepted in the well!'
Delay message: '&cYou cant make another wish for %s seconds!'
auto-update: true
Remember: all percentage amounts must equal up to 100. If it goes over, some items may not have the correct chance values. If it is below, the player might not receive any items even if it registers the player as "winning".
Hey! This seems like a great plug-in, and I'm trying to use it in 1.20, but I don't see the well.use or the other well. command, what do I need to do? I wanna try to use this plugin for my wife.
this plugin is great! my friends and i enjoy it a lot.
one question, how would you put enchantment books (eg mending, protection, silk touch) in the configuration?
thank you!
how do you use the well.use command? i cant get it to work unless everyone is op'd.
Just started trying to set up a wishing well and have made one in my world. Messages Seem to work and so does cooldown. It takes my item and all that. The only issue is when It says I win I don't get any item. Here is the config, can anyone see what the issue could be? Are there any scenarios where the well I have built is the problem? its just a simple stone well with water.
Delay: 600
Accepted:
- GOLD_INGOT
Returned:
item1: -DIAMOND 1
item2: -FISHING_ROD 1 luck_of_the_sea:3 unbreaking:3
item3: -COOKED_CHICKEN 10
item4: -GOLD_INGOT 2
item5: -PAINTING 1
item6: -SUSPICIOUS_STEW 1 name:FunSoup
ReturnedChance: item1:5 item2:7 item3:30 item4:25 item5:15 item6:25
CongratsMessage: '&aYou got a new item back from the well!'
TooBadMessage: '&cOh no. You lost your item in the well. Too bad loser!'
ItemNotAccepted: '&4That item isnt good enough for this well!'
Delay message: '&cYou cant make another wish for %s seconds!'
auto-update: true
wellLocs:
LuckyWell:
==: org.bukkit.Location
world: world
x: 539.5128005825259
y: 63.0
z: 1401.6071551555785
pitch: 58.4996
yaw: 5.3605957
The other thing is the permissions, I don't know how to set them I see that you need to use "well.use" but I don't know where that goes or how to format it.
How do I set permissions to other people? Currently only I can throw stuff in the well.
In reply to joswuuuhhhh:
I have been having issues applying Knockback and frostwalker to items in the well, is there separate formatting required for enchantments?
this is what i have for the problematic items
item3:
- IRON_BOOTS 1 frostwalker:2
item6:
- WOODEN_SWORD 1 knockback:2
help appreciated
I have been trying to add items to this plugin for awhile, at first it worked pretty well. However now since I've decided I want to add more items, everytime I make a well the next time I log in and do /well list and it says I have no wells created. Here's what I have,
Delay: 60
Accecpted:
GOLD_INGOT
Returned:
item1:
- BUCKET_OF_TROPICAL_FISH 1 name:&6NEMO
item2:
- BOW 1 power:3 infinity:1 name:&bMERIDAS_BOW
item3:
-COOKED_CHICKEN 8 name:&lHEiHei
item4:
-PAPER 1 name:&lEXCHANGE_FOR_HEAD
item5:
-DIAMOND 1 name:&lDoopysDiamond
item6:
-COOKIE 16 name:&lHansel&GretelsCookies
item7:
-DIAMONG_BOOTS 1 durability:1 name:&bCinderellasSlippers
item8:
-STICK 1 knockback:10 name:&fMagicWand
item9:
-IRON_BOOTS 1 frostwalker:2 name:&bElsas_Boots
item10:
-GOLD_PICKAXE 1 efficency:4 name:&lFixItFelixs_Hammer
ReturnedChance:
item1:15
item2:5
item3:20
item4:10
item6:15
item7:5
item8:15
item9:5
item10:10
ChanceOfNoReward: 0
CongratsMessage: '&aYou got a new item back from the well!'
TooBadMessage: '&cOh no! You lost your item in the well. Too bad!'
ItemNotAccepted: '&4That item isnt accepted in the well!'
Delay message: '&cYou cant make another wish for %s seconds!'
auto-update: true
I'm getting the same error as mattyblacknblue. Was there ever a resolution for this? I really like this plugin, I think it makes for a really cool intractable object in a town. Also, in 1.13 items aren't taken by wells with water because they float.
I've been having a ton of difficulty with customizing this plugin. I've attempted to add my own items but they don't seem to work, I've tried everything.
Here's part of my config:
----------------------------------------------------
Accepted:
- EMERALD
Returned:
Hoe:
- WOODEN_HOE 1 durability:0 name:Wooden_Hoe lore:&4Better_luck_next_time!
Skull:
- SKELETON_SKULL 1 durability:0 name:Skeleton_Skull lore:&4Better_luck_next_time!
Bones:
- BONE 3 durability:0 lore:&4Better_luck_next_time!
FishingRod:
- FISHING_ROD 1 durability:0 name:Fishing_Rod lore:&4Better_luck_next_time!
Gift:
- DIAMOND 5 durability:0 name:&2&l&oDiamond_Gift lore:&4Treasure!
ReturnedChance:
Hoe: 5
Skull: 5
Bones: 5
FishingRod: 5
Gift: 80
----------------------------------------------------
I've added in the durability enchantment because it wasn't working without it (or with it). I was able to get an item out of it one time out of 100 attempts and it was formatted perfectly but not a single other time has worked. When I set the "ChanceOfNoReward" to 0 the well takes the item and presents no returns or messages but if I set "ChanceOfNoReward" to anything as small as 1 I get the fail message every single time. I've tried reinstalling the plugin a few times already with no change.
Any ideas on what may be wrong? I would really appreciate the help!
~ Matt
In reply to mattyblacknblue:
Are there any errors in the console, either in start up or when you try to use the well? If you're setting the "ChanceOfNoReward" to 0 and you are not recieving an item, then wishing wells is most likely having difficulties loading the items.
Also, you could try adding apostrophes before and after the string, just to make sure that bukkit knows that that the items are supposed to be messages (For certain characters like &, ', or :, bukkit needs the apostrophes to know what is a message and what is formatting).
In reply to ZombieStryker:
great addon! is there any way to have a separate item/reward list for each well?
I got the config working and all my items in that I want to use and it works perfectly!...... Just for me.... No one else on my server but me can throw the object into the well. Am I missing a permissions thing or something?
Edit: I am running 1.13.2
In reply to Goldnhobo:
v1.0.9 keeps spitting this out on my server console. The config.yml does not have any invalid characters in it and I followed the example formatting contained within the file. I also removed spaces from all name:namehere metadata in the config (after reading a mention of that causing problems in a previous version here) in case that had anything to do with it.
25.10 14:30:13 [Server] WARN java.lang.NullPointerException 25.10 14:30:13 [Server] WARN at me.zombie_striker.wishingwells.Main.itemStackParser(Main.java:280) 25.10 14:30:13 [Server] WARN at me.zombie_striker.wishingwells.Main.onEnable(Main.java:89) 25.10 14:30:13 [Server] WARN at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:264) 25.10 14:30:13 [Server] WARN at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:337) 25.10 14:30:13 [Server] WARN at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:402) 25.10 14:30:13 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugin(CraftServer.java:384) 25.10 14:30:13 [Server] WARN at org.bukkit.craftbukkit.v1_12_R1.CraftServer.enablePlugins(CraftServer.java:333) 25.10 14:30:13 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.t(MinecraftServer.java:422) 25.10 14:30:13 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.l(MinecraftServer.java:383) 25.10 14:30:13 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.a(MinecraftServer.java:338) 25.10 14:30:13 [Server] WARN at net.minecraft.server.v1_12_R1.DedicatedServer.init(DedicatedServer.java:272) 25.10 14:30:13 [Server] WARN at net.minecraft.server.v1_12_R1.MinecraftServer.run(MinecraftServer.java:545) 25.10 14:30:13 [Server] WARN at java.lang.Thread.run(Thread.java:745)
One of my coder friends also tried to look into this for me to see if there was an error in the code, but he was unable to find your source code anywhere. Your source code should be available under the GPLv3 license.
I can provide my server's config.yml for your plugin if requested.
In reply to daemnyxea:
Most likely, what is happening is that you are still using the IDs for the rewards instead of using the Material names. If you were using the config posted above, it seems I forgot to update that when I was making the plugin support 1.13.
You can either delete the config and let it regenerate, or you can manually replace the IDs with the material names.
In reply to ZombieStryker:
I used the example that was within the v1.0.9 config.yml since that was the latest version and the only version of the plugin that I have ever installed.
This is my config.yml. I am fairly certain that it follows the correct formatting. If there is indeed something wrong with it, please give me a clearer idea of what it wrong. I'm pretty sure I used the material names, though.
https://pastebin.com/8mzgpSu4
EDIT: I am now puzzled. Did I use the material IDs or is something else considered the material IDs? I thought these were the material IDs and the original config uses two examples that are the same regardless of where you look for the IDs to use.
In reply to daemnyxea:
https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html#LEGACY_TOTEM
In reply to ZombieStryker:
Unfortunately I cannot upgrade to 1.13 just yet since myself and most of my server members are waiting for a few more client-side Quality-of-Life Forge mods to update to 1.13, but we will be updating within the next month or two. Since I now understand the problem, fixing it will not be an issue and I can just set this version of the config with the newer names aside until the time comes, and correct the material names to the old ones in the meantime.