iProfessions
Heypoday,
iProfessions is a complete plugin for making a job-based economy for your server. Players will have a profession (Miner, blacksmith, ... Whatever you want) and will be the only players who could do some actions. For instance, if you create a blacksmith profession and give them some craft skills, only blacksmith players could craft weapons, shovels, ...
Of course, you create your professions, this is not pre-defined professions. iProfessions tries to make professions as customizable as possible, you can give them craft skills, destroy block skills, use item skills and many others.
It also offers more features like tree-profession (Make specialisation of profession), economy support, required field to learn a profession,...
Last thing, you can use iProfessions with BeardStat to use the required features (Allow a job only when player has done some things)
Hope you'll enjoy the plugin, very usefull if you have a lot of player and you want to make a real job-based economy. :)
/!\ This plugin NEEDS PluginsBaker to work, don't forget to install it ! :)
French Topic | Github | Bukkit Thread
Authors: Ptibiscuit
How to use
Configuration
Open config.yml, there's 3 parts of this config. Players will be filled by itself. Config contains some config:
- max_profession: Number of professions that you're player can have. The professions' configuration is a bit hard, there's a tutorial for How to create your profession at the end of this page, hope you'll understand it well. :P
Commands
- /plearn <Tag's profession> (iprofessions.learn.<Tag>): Learn a profession. The permission for this command changes depending of the profession. If the player wants to learn the profession "miner", he would have to have the permission "iprofessions.learn.miner".
- /pforget <Profession> (iprofessions.forget): Forget one of your profession.
- /paddprofuser <Player> <Tag's profession> (iprofessions.user.profession.add): Add a profession to a player.
- /premprofuser <Player> <Tag's profession> (iprofessions.user.profession.remove): Remove a profession to a player.
- /pwhois [Player] (iprofessions.whois.other): Display job of an other player.
- /pwhois (iprofessions.whois.self): Display your job.
- /plist <Profession> (iprofessions.list): Display the list of all online players who has this profession.
There are some special permissions:
- iprofessions.god: Allows the player to do anything, even if he hasn't the good profession.
Create your profession - Step to step tutorial
Outch, outch, i'll try to be the cleariest as possible for this tutorial. First of all, here is a ready-to-fill yaml configuration to create your professions:
professions: [Tag]: name: [Name] price: [Price] parent: [Parent] required: - category: [Category] key: [Key] require: [Require] hasnot: [Hasnot] skills: breakBlock: - id: [Id] hasnot: [HasNot] smeltItem: - id: [Id] hasnot: [HasNot] craftItem: - id: [Id] hasnot: [HasNot]
For this tutorial, we're gonna create a blacksmith profession (Read those operations while looking at the result at the bottom):
The tag of this profession will be blacksmith, it means that player will have to use "/plearn blacksmith" to learn this professions.
The name of the profession will be "Blacksmith", this field is the clear name of the profession with capital letter, spaces, ...
The price is the money player will have to pay to learn this profession. I choose that learning blacksmith will cost 150 iConomy money.
The parent field is special, it will be explained in the following part, it is usefull for creating tree of profession. For my blacksmith, I'll delete this field. :)
Required field contains a list of all the required to learn this profession. For our profession, in addition to paying 150 iConomy money, players should already have broken 15 blocks of stone and 10 blocks of coal. Hasnot field is displayed when a player has not accomplished the required field. ("{LEFT}" will be replaced by the number of action left to accomplish the required (Need to break 15 blocks, I've broken 10 blocks, {LEFT} = 5 :P ))
Required field are handled by BeardStat plugin (You can use iProfessions without using BeardStat, but so, you can't use the required field)
At this point of the tutorial, here is our profession:
professions: blacksmith: name: Blacksmith price: 150 required: - category: blockdestroy key: stone require: 15 hasnot: You have to break {LEFT} block(s) of stone. - category: blockdestroy key: coalore require: 16 hasnot: You have to break {LEFT} block(s) of coal ore. # And the rest ....
Now, the most important part of the configuration, skills !
When you give a skill to a profession, only players of this profession will have this skill and be able to what the skill says. For our profession, only blacksmith can craft golden and diamond tools (shovel, sword, axe, ...), break gold ore and iron ore and smelt those ore. Exactly like with the required field, hasnot fields are displayed when a player tries to do an action when he hasn't the right profession. Here is the all configuration of our black-smith profession:
professions: blacksmith: name: Blacksmith price: 150 required: - category: blockdestroy key: stone require: 15 hasnot: You have to break {LEFT} block(s) of stone. - category: blockdestroy key: ironore require: 16 hasnot: You have to break {LEFT} block(s) of coal ore. skills: breakBlock: - id: 14,15 hasnot: This block is too strong, only a black-smith can break it ! smeltItem: - id: 14,15 hasnot: It's too hot for me, only a blacksmith can smelt that ! craftItem: - id: 283,284,285,286,276,277,278,279,293,294 hasnot: I can't craft this item, maybe a blacksmith can ? ...
There's a lot of type of skill. Here we've just used 3 of them, but you have a list of all type of skills below.
You can also specify a metadata, like with wool ("35-4", "35-14", ...) or stairs.
If you want others example, to see how make a complex schema of professions, you can check the Free sample, I'll try to create a lot of samples. :)
Types of skills
Tag | Purpose | Example of configuration |
---|---|---|
craftItem | Allows the craft of an item | id: 257 hasnot: You can't craft that. |
smeltItem | Allows the player to put an item in the smelt slot of a furnace | id: 14,15 hasnot: You can't smelt that. |
breakBlock | Allows the player to break a type of block (All players are able to break block that have been placed by a player during a same server instance (If you reload or restart the server, players won't be able to break blocks that have been placed).) | id: 1 hasnot: You can't break that. |
placeBlock | Allows the player to place a type of block | id: 2 hasnot: You can't place that block. |
gainMoneyOnBreakBlock | Player will win money when he'll break a block (Don't win money with a block they have placed) | id: 1 reward: 1 |
gainMoneyOnKillCreature | Player will win money when killing a creature. (List of all types of creature here) | type: PIG,CREEPER reward: 50 |
dropItem | Allow the player to receive drop when breaking an item. | id: 1,5,2 |
wearItem | Allow the player to wear an item (helmet, boot, ...) | id: 306 hasnot: You can't wear that |
Make a tree of profession (specialisations)
You can make specialisations for professions, those professions gets the skill of their parent profession with the skill they have. Also, learning one of those professions requires to have learn't the parent profession. For instance, I want to create 2 professions:
Miner, players would first have to learn that professon. Miners can break Iron ore and Redstone Ore.
Then, players can choose between 2 professions:
Gold Miner, they have all the skills of Miner plus breaking Gold ore.
Diamond Miner, I think you have understood the thing, they have miner skills plus breaking Diamond ore.
Here is a simple schema which explains the situation:
And here is the configuration to create those kind of professions:
professions: miner: name: Mineur skills: breakBlock: - id: 15,73,74 hasnot: This block is too hard. gold_miner: name: Mineur d'or parent: miner skills: breakBlock: - id: 14 hasnot: This block is too hard. diamond_miner: name: Mineur de diamant parent: miner skills: breakBlock: - id: 56 hasnot: This block is too hard.
Notice the "parent: miner" field added for the gold_miner and diamond_miner profession.
Last thing, you have to write sub-profession AFTER the parent profession !
Make group of professions
It's an other feature that allows you to force your player to take a specific combinaison of profession. For instance: Imagine I'm trying to make a server WoW-Like. In World of Warcraft, you have basically 2 kind of professions crafting and farming profession. Farming profession are like miner, herbalist, sheep shearer, ... Crafting profession are like blacksmith, tailor, alchemist, ... In my server, I have 6 profession: miner, herbalist, lumberjack, blacksmith, alchemist and engineer. The first three are my "farming" professions, and the last three are my "crafting" one. :) In my server, players can take 2 professin, but, I want that they can take only 1 farming profession and 1 crafting profession. Well, with iProfessions, that's possible ! :D Go to your config, and find the "professions_group" node. By default, you have that:
config: max_profession: 2 profession_groups: - max_profession: 1 professions: - farmer - miner
If you have nothing, try to generate a new configuration by deleting your actual config (Don't forget to make a copy ;X) and reload the plugin. For my server, I'll create 2 groups, set the max_profession for each group to 1, and list all my "farming" professions and my "crafting" professions. Here is the result:
config: max_profession: 2 profession_groups: - max_profession: 1 professions: - lumberjack - miner - herborist - max_profession: 1 professions: - blacksmith - tailor - alchemist
Logically, the sum of all the "max_profession" of all your groups should equal to the global "max_profession" of your config. (Here, 1+1=2) /!\ Last thing, if you're working with specialization (To set up a profession tree), "professions" node in your groups have to contain only root professions (Profession that has not parent).
Link a group to a profession
If you want that when a player learn a profession, he's added to a group, well, linked_group is for you ! :P To configure a linked group, just add this to a configuration of a profession:
professions: miner: name: Mineur linked_group: miner price: 50 ...
When a player will learn the profession "miner", he will be added to the group "miner". When he forgets or he specializes the profession "miner", he will be removed. /!\ If you use the linked_group feature, you can't change the profession of a player by modifying the file because it would desynchronized groups and professions !
List of all the category of required
In the tuto, we used the category "blockdestroy", but there are more than just this one. Actually, there isn't a list of all valid category-keys, cause this is managed by BeardStat. You can easily, if you turn the config to a Database, check your database too see all the possible category. Here is a little list of my database. :)
Category | Key | Description |
---|---|---|
blockdestroy | iron, dirt, ironore, stone, ... | Block destroyed, I don't think you need more explanation :P |
itempickup | sapling, dirt, ... | Idem |
crafting | wood, ... | This is crafting item |
blockcreate | ironore, ... | Placed and not craft item ! |
deaths | total, fall, ... | Number of deaths |
stats | chatletters, chat, login, move, playedfor, firstlogin, lastlogin, lastlogout, totalblockcreate, totalblockdestroy, damagehealed, move, | This is stand-alone stat |
kills | skeleton, spider, total, ... | People killed |
damagetaken | fall, arrow, skeleton, total,... | |
damagedealt | arrow, skeleton, entityattack, ... | |
itemdrop | wood, ... | |
exp | currentexp (The current level), lifetimeexp() | |
Use sign to make actions
You can create signs that make actions for player when they interact with them. It is simple, write "[iProfessions]" for the first line of the sign. For the second line, it depends of what you want the sign does:
- learn <tag's profession>: Will do exactly what "/plearn" does, try to learn a profession (permission: iprofessions.sign.learn.<Tag>). For instance, the permission to learn the profession "miner" with a sign is "iprofessions.sign.learn.miner".
- forget <tag's profession>: Will do exactly what "/pforget" does. The required permission to use the sign is iprofessions.sign.forget.<Tag>
- Maybe some other action, in the future. :)
Exemple, if you havn't understood: :P
Bonjour,
Est il possible d'empecher le drop de viandes lorsque l'on tue un animal et la peche de poissons par toute personne qui ne serait pas chasseur par exemple. Voir carement d'empecher les joueurs non chasseur de tuer les animaux.
Sinon y a t-il un autre plugin qui puisse faire cela?
Merci
@Junatess
I am having the same problem when I try to load the IProfessions for my server this error message appears:
[SEVERE] Error occurred while enabling iProfessions v3.2 (Is it up to date?) java.lang.NumberFormatException: For input string: " 14" at java.lang.NumberFormatException.forInputString(Unknown Source) at java.lang.Integer.parseInt(Unknown Source) at java.lang.Integer.<init>(Unknown Source) at com.ptibiscuit.iprofession.data.models.skill.SkillSimpleId.onEnable(SkillSimpleId.java:27) at com.ptibiscuit.iprofession.data.models.skill.SkillBreakBlock.onEnable(SkillBreakBlock.java:27) at com.ptibiscuit.iprofession.data.YamlData.loadProfessions(YamlData.java:101) at com.ptibiscuit.iprofession.Plugin.onEnable(Plugin.java:53) at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:217) at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:365) at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:381) at org.bukkit.craftbukkit.CraftServer.loadPlugin(CraftServer.java:265) at org.bukkit.craftbukkit.CraftServer.enablePlugins(CraftServer.java:247) at net.minecraft.server.MinecraftServer.i(MinecraftServer.java:296) at net.minecraft.server.MinecraftServer.d(MinecraftServer.java:275) at net.minecraft.server.MinecraftServer.a(MinecraftServer.java:225) at net.minecraft.server.DedicatedServer.init(DedicatedServer.java:140) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:380) at net.minecraft.server.ThreadServerApplication.run(SourceFile:539)
Nevermind, I've just realised there was a space in front of some numbers.
@MsPtibiscuit:
:-( Dommage. Ca corrompt tout mon projet. Je vais devoir revoir ma copie.
Merci pour ta reponse si rapide.
Ca reste un exellent plugin, que je recommande.
Merci MsPtibiscuit pour le suivi que tu assure.
@Lafeve
useItem a été enlevé car elle es trop contextuelle, elle ne doit être utilisé que pour les objets comme l'EnderEye.
Pour l'instant, il n'y a rien pour l'utilisation d'objet car il n'y a pas un skill qui regroupe tout, ce serais impossible à faire. A l'heure actuelle, je ne peux faire que des pseudo-skills déguisés (Genre un useItem qui fonctionnerait pour tous ce qui est outils, mais pas pour outil, ...)
Bref, il n'y a rien à l'heure actuelle qui permettent de faire ce que tu as envie de faire. :)
Bonjour,
J'utilise la commande useItem pour empecher tout joueurs qui n'est pas mineur d'utiliser la pioche. Cependant je rencontre un petit probleme: Lorsque je suis en jeu, j'ai bien le message qui me dit que je ne peux pas utiliser la pioche si je ne suis pas mineur (hasnot:) mais je peux quand meme l'utiliser.
Encore un petit mystere à resoudre. Je ne vois pas trop d'ou viens mon erreur. Je peux vous fournir ma config si necessaire.
Quelqu'un a une piste?
Merci d'avance !!
@MsPtibiscuit
Dans le groupe ? Je n'ai pas crée de groupe ! Mais je suis sûr d'être dans le métier en question. Je vais regarder ce que vous appelez "groupe" j'ai du oublier quelque chose... Ce qui est bizarre c'est que le chasseur arrive à gagner de l'argent en tuant les mobs :/
EDIT : J'ai bien la dernière version. PS : J'ai crée les groupes de profession, mais je n'ai pas fait de "lien" entre ces groupes et chaque métier. Ca viendrait de là ? Pourtant le chasseur arrive à gagner son pain... :/
@Valentiniuss
Bizarre, bizarre, es-tu sûr d'être dans le groupe quand tu essaie de gagner de l'argent ?
Tu as bien la dernière version d'iProfessions . :)
@Woodhunting
Hi WoodHunting !
I had this problem in past. Your config file is not good !
See line 27 and 31.
It's an alignment problem ! See this example (http://dev.bukkit.org/server-mods/iprofessions-new/pages/free-samples/)
Bonjour !
Comme je sais que vous êtes français, autant ne pas m'embêter à parler Anglais ;)
Super plugin ! Je vous félicite ! Complet et puissant !
Cependant, un petit soucis non négligeable. Mais joueurs ne gagnent pas d'argent en cassant les blocs.... Pourtant aucune erreur dans la console.
J'espère que vous trouverez d'où ça peut venir...
Merci d'avance !
Voici un extrait de ma configuration :
A noter que les accents ne sont pas sur la version finale du fichier (car ils sont pris en compte sur mon serveur en local, mais pas sur le serveur en ligne...).
Merci d'avance !
Musicalement,
Valentiniuss
Hi! Please help! This is my config file: http://pastebin.com/ZUmV1SRR
It gives me these errors: http://pastebin.com/q2N3s98a
Please help! This is quite urgent!
@failtolawl
It is incorporate, but I can't test the plugin cause my usual test server is down. Hopefully, I could release the new tested version for Monday. :)
was wondering when you are going to incorporate the forget signs and professions wearing certain items, it would greatly appreciated if you could incorporate this in to your plugin, thank you.
org.bukkit.command.CommandException: Unhandled exception executing command 'padd profuser' in plugin iProfessions v2.0 at org.bukkit.command.PluginCommand.execute(PluginCommand.java:42) at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:16 6) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:4 79) at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler. java:821) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:781)
at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:764) at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:34) at net.minecraft.server.NetworkManager.b(NetworkManager.java:229) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:113) at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:7 8) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:567) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:459) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) Caused by: java.lang.NullPointerException at com.ptibiscuit.iprofession.Plugin.onCommand(Plugin.java:152) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) ... 12 more
error i get when i try /paddprofuser <Player> <Tag's profession>
msptibiscuit hop on skype sometimes again i got an new idea/qeustion if you stil remember me ;P
Damn it !! It's too hard for me :D Okkkkayy... In console, when I break a stone/coal ore i get this:
. When I have broken 5 blocks of stone/coal, a number of left blocks to break is not changing (cmd /plearn blacksmith).. but when I break 15 stone/ 16 coal, after typing /plearn blacksmith, I get this: 
EDIT Still don't know what's wrong. I have iConomy,BeardStats,Vault & PluginsBaker, I can break gold ore despite the fact that only blacksmith can break it. Heeeelppp ! :D
@Kubixster
Do you have BeardStat ? :)
Broken 15 stones & 16 coal ores.. Typing '/plearn blacksmith' and getting this :
Broken next 15 stones & 16 coal ores.. I'm gettin this again. What's wrong ? :<
My config:
Sorry for bad english.. :< :D
@deleted_7919568
Have a look at the spaces before each line, "farmer" has only 1 space, but it requires 2. Yaml is pretty annoying with those things (I wouldn't have chosen Yaml to make configuration, personnaly)
And you have skills about the "id" 0, it is a bit useless, unless you want to fill them. But remove them, I think it will cause bad behavior (Specially for the craftItem). I let them in the file, but du something with. :)
I deleted the group_professions, it won't make any problem, read the part about the group profession if you want to add some later.
Here is the clean config:
http://pastebin.com/2SjgwMu4
Heres my Startup log: http://pastebin.com/mjXRqdKa I want all of my skills. I just can't seem to figure out why my server won't accept me trying to use any classes.
@deleted_7919568
You can delete all the skills you don't use, see http://dev.bukkit.org/server-mods/iprofessions-new/pages/free-samples/ if you want some exemples. ;)
And, you'll have to give me the rest of the error, after the "Cannot load ..."