MagicBookshelf by Tim Clancy - 1.2.5 Compatible
Magical Bookshelves!
Release of Source Code:
As of 2.11.14, Tim has released all code free for use here: https://github.com/TimTinkers/MagicBookshelf. The code you will find there is the plugin in its most current state. Enjoy, and feel free to reproduce in any manner you'd like, just so long as credit is always given for any code used. It would also be very kind of you to link to this page as well.
Goal:
This plugin seeks to improve upon the vanilla Minecraft enchanting system.
The Minecraft system takes a very long time to get to higher levels of experience, and resets you to a much lower level upon dying. This encourages many players to make mob grinders to try and earn experience, which is not fun for anyone. The way MagicBookshelf tries to fix this is by allowing players to quickly and simply store their experience points inside of bookshelves, to be withdrawn later. By allowing users to slowly build up their levels over time, it is possible to get to that 30th level without sitting at a mob grinder all day.
Features:
Right-click a bookshelf to store your experience inside it.
Left-click a bookshelf to take the experience out of it.
Add a sign with [XP_Private] on the first line, followed by up to three usernames, to lock a bookshelf for certain users. Only these users will be able to break, withdraw from, or deposit to that bookshelf.
Permissions supported:
- magicbookshelf.lock gives users the ability to lock their shelves.
- magicbookshelf.break gives users the ability to break ANY shelves.
- magicbookshelf.store gives users the ability to store xp in shelves.
- magicbookshelf.withdraw gives users the ability to withdraw xp from shelves.
It's that easy! Video of use:
If you are Polish, adeknijak made this neat video:
If you are Czech, LPmareonCZ made this neat video:
Configuration:
There isn't any way to configure settings right now. Just be certain that the MagicBookshelf folder (and its included shelves.txt file within) make it into the plugin folder. There are both Java 7 and Java 6 versions, choose Java 6 if you aren't sure.
To do
- Add configurable settings.
- Add permissions support.
- Add an effect to bookshelves that have experience in them.
@BulletSix
@dirtyearsbill
Minecraft 1.3 changed the way experience curves work, and changed the level cap to 30. This means that the formula I use for this plugin is wrong now. This plugin is not updated to Minecraft 1.3 yet.
@BulletSix
I noticed the same issue yesterday as well.
hiya,
i get strange behaviour with Minecraft 1.3.1 and MagicBookshelf 0.7 each time i retrieve the stored XP i get some more the amount back ... i started with about 300XP stored pre-update and ended after quite a few storing-and-retrieving with about 9300XP where it stays constant. On the other hand, i got together a few XP ( less than 15 i think) and then i endet up with zero after a few transfers with the shelve.
Any ideas what could be wrong?
Exactly what I have been looking for, thanks!
@Derthmonuter
It's actually kind of nice. To get rid of it though, couldn't you just add "+1" to all calculations, or would that potentially give people unlimited experience by just withdrawing 0, but getting 1?
Anyways, that little 1 is a not much, but kind of a nice little fee in my opinion. Still looking forward to the "require sign" option! Bookshelf-infested enchanting tables have the capability of screwing up someone's experience if they unknowingly slap one!
Thanks again for staying on top of things and I hope to see an update soon! :)
@Chaznuts
Oops, look down there.
@dirtyearsbill
@dirtyearsbill
The one xp point that gets taken away is actually the result of rounding errors on the part of Bukkit. There's no way to completely eliminate it, but I could add support for increasing it for sure.
@Chaznuts
Well, I figure adding a tax, along with the trouble of having to withdraw from a bunch of different bookshelves, would discourage it enough, but having the option to limit it certainly wouldn't hurt either.
@dirtyearsbill
I agree with what dirtyearsbill said, and have one addition. Add a limit in the config of how many bookshelves a user can have at one time. No point to add a cap in each shelf if they just make 20 shelves right next to each other! :)
Love the plugin. Looking forward to your updates in the future! Just had a couple suggestions (obviously for when you add a config).
1) I noticed that you lose 1 exp any time you withdraw and add again. Would there be a way to set how much is taken each time? Sort of like a tax for storing exp? 2) Would there be a way to cap how much exp a user is able to store at any given time?
I have a few users that think it cheapens the exp/enchanting process by making it too easy to get to a higher level, so I was trying to think of some ways to counter that while still keeping it useful.
Thanks again!
@Chaznuts
Hi there! I used to have that, but it made it a pain in the ass to build anything with bookshelves. I can probably add an option in the config. And I promise there'll be some progress on this plugin eventually! Thanks for the bug report too, I'll take a look at it.
Any way to allow depositing/withdrawing while holding any item (not just a hand) in the next update? :) Also, I think I found a little bug.. I added some exp to my friend's bookshelf BEFORE he locked it with a sign. Once he locked it, he was unable to add/take from it (and neither could I for that matter), but once the sign was taken off, I could take my exp out again. Kind of strange, but might be a simple fix by requiring the bookshelves to have a sign in order to allow experience storing! Thanks!
@Derthmonuter
That works. I'd be fine with an admin in-game command too that stopped regular bookshelves from being xp-storable, but it seems like a config would be... better. Thanks :)
@Chaznuts
Well, when you say add something in the config, that would first require me to add a config itself. XD
But in all seriousness, I'll definitely try to add something for you once a config file exists in the first place.
@Zedreth
You need a permission plugin, such as PermissionsEx, Group Manager, or one of the sort. You can also use the standard bukkit permissions, but a lot of people are against that (never tried it personally).
@Derthmonuter
As for the plugin... can you add something in the config that forces people to have a sign on the bookshelf to make it a "magic bookshelf"? 'Required-Sign: true/false' would be perfect, as it helps identify which shelves are being used and reduces the accident of unaware players losing exp by not knowing what they're doing or even being tricked by other players to deposit their exp and get it stolen.
I love this plugin and hope to see this small addition added soon! Thanks for your hard work and keep it up! :)
I'm running a server right now with this plugin. I see you have those nodes there but how exactly to I implement them? I tried making a config.yml file and putting them in there but it doesn't seem to be working. Could you explain?
How exactly do you set those permissions?
@SomeRandomGameDev
Thanks. :)
And yeah, that's what I tried at first. It doesn't update when an enchanting table gets used though, so people were exploiting for infinite experience. There's still an unanswered ticket for the issue on leaky Bukkit.
@Derthmonuter
I was thinking about calling setTotalExperience to 0 and then giveExp with the stored exp. But it is just a guess. Never tried it.
By the way, I use your plugin and it's just a must have for me :)
@SomeRandomGameDev
I do, but there is a fault in the Bukkit methods for setTotalExperience. As such, it does not properly update when a player uses an enchanting table, which will lead to either infinite experience being generated, or no experience being generated. I use giveExp with a simple formula for finding their total experience count. It's not perfect, but it's only off by one or two in any given case, so it's an acceptable solution.
Does this sum up the "pseudo-real voodoo" for you?