EconXP
Overview
version: 0.5.0
| craftbukkit: #1.3.1
| Source | Developer API
Features
- Let players use their experience points to buy things! Since people can already buy Enchantments with experience points, why not buy be able to buy from shops as well!
- Supported by Vault!
- Works with Minecraft 1.3.1!
- Simple config file!
- No permission system needed (though there are permissions available if you want them)!
Description
EconXP is an economy system that users the player's experience points (the green orbs collected from monsters) as the currency. With the introduction of Enchanting costing experience, it will be interesting to see economies based around the concept of trading experience points, especially since they are already naturally collected and used, thus giving them an inherent value.
EconXP is now supported by Vault, so any shop or currency-related plugin that uses Vault can have EconXP as its currency type! I will also be adding Register support later, allowing EconXP to be used with many existing shop and economy-related plugins.
Minecraft Levels and Experience
Minecraft's levelling system is a bit strange and can be confusing to some people. Here's a quick explanation of how it works.
Players collect experience by slaying monsters, and the experience appears as green orbs on the ground. Upon receiving experience, players gain levels. As of MC 1.3.1, the calculations have changed for levels. I'm too lazy to write out the actual equations, though, so you'll have to check out the Minecraft wiki: MinecraftWiki.net
Developer API
Check out the API description here: Developer API
Configuration File
Configuration file can be found after starting the server, under the EconXP folder (inside the plugins folder).
Quote from the Config file:death-drop-percent: 100 - [0 to 100] By default, all players drop all of their experience (rather than only 60% of the old total). Do NOT use decimals here (or a percent sign). Set this to 0 (zero) if you do not want players to lose their experience points when they die.
Commands
Commands are OP-only by default, with the exception of the balance (self-only) command. Therefore, players should not be able to transfer experience unless given permission to use the command. All commands map 1-to-1 with the respective permission (see the Permission section below).
All commands can use abbreviated forms. For example, you may type /exp bal instead of /exp balance. Player names and amounts can not be abbreviated, however (for obvious reasons). Capitalization of player names does not matter, though.
All <amount> and <factor> values must be positive (greater than or equal to zero). All <amount> values must be whole numbers.
Quote from the Command list:/exp OR /econxp - The base commands (ie. /exp add Agnate 5 ). Either base can be used.
/exp add <player> <amount> - Add experience to the player.
/exp subtract <player> <amount> - Subtract experience from the player.
/exp multiply <player> <factor> - Multiply experience of a player by the factor.
/exp divide <player> <factor> - Divide experience of a player by the factor.
/exp set <player> <amount> - Set the experience of a player.
/exp clear <player> - Clear ALL of the experience of a player.
/exp balance - See your current experience points.
/exp balance <player> - See the current experience of a player.
/exp give <player> <amount> - Give some of your experience to a player.
/exp transfer <giver> <amount> <receiver> - Transfer from Giver to Receiver.
Permissions
Permissions are required to use any of the commands. Players can receive experience without having any permissions.
Quote from the Permission nodes:econxp.* - Allows all commands. econxp.add - Allows player to use the add command.
econxp.subtract - Allows player to use the subtract command.
econxp.multiply - Allows player to use the multiply command.
econxp.divide - Allows player to use the divide command.
econxp.set - Allows player to use the set command.
econxp.clear - Allows player to use the clear command.
econxp.balance - Allows player to use balance to check players' balances.
econxp.give - Allows player to give their own experience to a player.
econxp.transfer - Allows player to use the transfer command.
To Do List
My current to-do list:
- Finish Register support. (on hold until Vault is finished)
- Add some examples to the Develop API.
Changelog
View the Change Log.
Credits
- Flamers for helping with the banner's screenshot!
- Nijijokun for posting his iConomy source (and thus helping me figure out JNBT)!
- garbagemule for inspiration and code help along the way!
"Good news everyone!" Dunno if this is something of interest for anyone here but Essentials has decided to accept my request of linking the EssentialsEco signs with Vault. This means that it is now possible to use EconXP for the currency and the signs from Essentials for trading. For me the search of a nice and simple trading plugin is over and maybe it is also useful for anyone else here.
Again thanks to AgnateHeartstone for EconXP. :)
@Lightwave8 Yeah, I have to look into this. Not sure how MC is handling the purchase of enchants now.
I have a problem:
I'm using this with Essentials, and have discovered that if a player enchants something and then dies, they get all the exp they just used to enchant back.
Is this a problem with EconXP's xp handling on death, or a bug with the interaction between the two?
I have it set in EconXP's config so players keep all their exp when they die.
Looks like a bunch of experience-related things were updated in Bukkit with the latest release. I'll be sure to remove all the unnecessary code now that things are fixed.
I'll also fix up that enchantment level bug now that there's an API for the enchantment table. :)
@SalieriC Awesome, thanks!
@AgnateHeartstone
AllPay (the thing wich MultiVerse uses) promised to add support in their next release: https://github.com/FernFerret/AllPay/issues/16#issuecomment-3515622 I had to ask the developers of AllPay because the developers of MultiVerse denied my request for Vault. I think this makes it to something of interest for you.
@SalieriC Yeah, I haven't gone around asking for support because I don't use any of those plugins. Feel free to ask them to support EconXP, though. :) Or even just support Vault, for that matter (which is much easier to support).
@AgnateHeartstone
Thanks EllB and AgnateHeartstone for this information. But please if this is easy to implement then do so, I won't end up running 20 millions of plugins on the server, there are still too many of them un the server.
Seems that it is impossible to find one. I'll take another chance but I'm not so confident. And there is no way to force EssentialsEcon to use your plugin for the currency? This would also solve another problem: MultiVerse Portals also seems not to support your plugin.
Again thanks for your help.
@SalieriC I could easily add in the lost-on-death amount to my code. Alternatively, you can use the plugin that EllB suggested.
A lot of the shops support Vault now, so just hunt around the Economy section of the server mods. Unfortunately, I've always had issues with finding a shop setup that I liked, too.
@SalieriC
There is already several plugins for removing the experience orbs on death, such as this one. I'm leaving your other questions to someone with more experience of running economy servers.
This idea is very nice, I like it. But this is the first time I try to run an economy system on my server and I have no idea about existing shop plugins. I wasn't able to find a nice shop system using signs in the list for the Vault plugin but Essentials Economy comes with a nice simple one so: Is there a way to use EconXP for the currency for Essentials Economy? If not: Is it possible in the future? And can you point me a shop plugin? I wish to give my players the chance to set the prices by their own but many plugins seems to have fixed prices. (and of course this default prices don't realy fit with xp as currency.
And one last thing: Can you make a possibility to configure how much xp are lost on death. And with "lost" I mean "removed from the game", not the thing you still have in the config. I want to make it that the player who dies lost all of the xp without the chance to pick up this xp again.
@mojothejojo Vault allows for EconXP to be used as the economy system, so just find any shop plugin that supports Vault and you're good to go. :)
Hi
In really would like to use this plugin for an item store. But for that in would need an account wich has infinite amounts of exp. Ist there a way not to buy items from a player but from some kind of virtual player?
Hope u understood and can help me :)
Edit: Thank You =)
Awesome! I just tested out the new version. Everything is working nicely. Now I just need to decide what percentage of exp I want my users to loose when they die... :)
@adrianthewriter Got the death-drop for experience working! Check out version 3.0! (should be released soon, waiting for Bukkit approval) :D
@reldeam EconXP already works with Vault! :D I've had a couple requests for banks now, and I'm considering adding them. Haven't sat down to hammer out the details, though.
As for Minecraft's XP system, it uses a bitwise scale to determine levels: 7 + (level * 7 >> 1)
Haha, I became a member just so I could comment on this plugin.
This is a great idea, I'm assuming once you are hooked in with vault there will be a kind of bank plugin as well as shop?
Would you also be able to explain Minecraft's XP system because it seems 10 EXP doesn't equal 1 XP level in Minecraft.
Thanks for working so hard on this plugin, and running with my idea like that. I'm sorry it's not working like you (we) had hoped. Even without that change, econXP is exactly the right economy plugin for me. I've been testing in on my server and it's working like a charm. Thank you very much!
Well, the current version of EconXP was tested for the newest RB, and things are good.
I went about adding in the config option for drop-death-percent (the percentage of experience dropped on death). However, because Minecraft still calculates experience levels wrong, the level you receive upon respawn is actually incorrect (inflated), and is further exacerbated upon picking up the dropped experience (again because of the calculation errors).
At this point, there's no event fired when a user picks up an experience orb, so I can't manually do the calculations there. I also cannot (properly) update the experience after respawn (the PlayerRespawnEvent is fired *before* they actually receive their after-death experience, so it's not viable to use that).
I'll keep everyone posted on the progress, though. :)
@sausagestrangler As in using your money instead of experience at the enchanting table? I have no idea, to be honest. I know that Bukkit's enchanting API hasn't really been developed yet, so I don't imagine anyone has made one. Also, that's not really in the scope of EconXP, as EconXP has no "money"; it just lets you use your experience points at Vault-supported shops. :)
Love the idea- I have been using XP to money plugin- is there any chance of a plugin converting xp to economy costs when using the enchanting table?