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
20:00:51 [SEVERE] null org.bukkit.command.CommandException: Unhandled exception executing command 'plea rn' 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 forge.bukkit.ForgeCommandMap.dispatch(ForgeCommandMap.java:55) at org.bukkit.craftbukkit.CraftServer.dispatchCommand(CraftServer.java:4 97) at net.minecraft.server.NetServerHandler.handleCommand(NetServerHandler. java:843) at net.minecraft.server.NetServerHandler.chat(NetServerHandler.java:799) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:781) at net.minecraft.server.Packet3Chat.handle(Packet3Chat.java:34) at net.minecraft.server.NetworkManager.b(NetworkManager.java:234) at net.minecraft.server.NetServerHandler.a(NetServerHandler.java:119) at net.minecraft.server.NetworkListenThread.a(NetworkListenThread.java:8 3) at net.minecraft.server.MinecraftServer.w(MinecraftServer.java:579) at net.minecraft.server.MinecraftServer.run(MinecraftServer.java:467) at net.minecraft.server.ThreadServerApplication.run(SourceFile:492) Caused by: java.lang.IncompatibleClassChangeError: Found interface me.tehbeard.B eardStat.containers.PlayerStat, but class was expected at com.ptibiscuit.iprofession.Plugin.getStatValue(Plugin.java:487) at com.ptibiscuit.iprofession.Plugin.hasRequire(Plugin.java:477) at com.ptibiscuit.iprofession.Plugin.tryToLearn(Plugin.java:281) at com.ptibiscuit.iprofession.Plugin.onCommand(Plugin.java:111) at org.bukkit.command.PluginCommand.execute(PluginCommand.java:40) ... 13 more
i have tried this with 3 or 4 different version combinations of IProfessions and Beardstat and i cant find why this error is happening.
@MsPtibiscuit
Je sais un peu français seulement, donc je vais parler anglais. This plugin seems very awesome, but instead of using as a job system, I'll use it as an experience system. So instead of starting the game with the ability to use everything, you have to earn the ability to break/use certain blocks. Good job!
EDIT: Is it possible to automatically gain a profession or new ability without having to use a command. So if the user has met the requirements, they are automatically moved to the next group.
@MsPtibiscuit
Ce qui signifie que nous devons attendre des mises a jours de bukkit ? :/ Pour une fois que ce ne sont pas les créateurs de plugins qui doivent booster pour mettre a jour a force des mises a jours incessantes de bukkit :)
Penses -tu un jour develloper ton plugin en autorisant l'utilisation de spout , c'est a dire que l'on pourrait utiliser spout pour bloquer les crafts si l'on le désire ?
Cordialement
@Mastara
Normalement, l'API de Bukkit permet maintenant d'interdire le Craft. Mais l'API est nouvelle et encore instable, j'ai l'impression qu'elle ne fonctionne plus avec les nouvelles MAJ. :X
Salus a tous , pour certain skills , il faut vraiment bien regarder dans vos fichiers de config, en effet , mon skill breakBloc ne marchait pas , celais venait du faite que j'avais écris 17 au lieux de 17-0 ( pour le bois)
J'ai par contre encore un problème avec le skill craftItem , je me demandais si il ne fallait pas spout pour interdire les craft ?
Merci de votre aide :)
Petit soucis avec la version 3.2, il y a un log a chaque interraction dans l'inventaire (commit #d6b4cfa). C'est légèrement embétant, ça polu très rapidement la console de log.
Merci ;)
Même chose que Mastara il reconnait les professions mais il refuse de faire en sorte que les skills marchent
Voila la config http://pastebin.com/aKeLvE5Y
@MsPtibiscuit
Voici ma config:
http://pastebin.com/qekPxNbr
@MsPtibiscuit
Voila ma configuration , je l'ai un peu changée , mais il doit encore y avoir des erreurs , en effet , les jobs sont maintenant reconnus mais les skills ne sont pas appliqués : En effet , le mineur arrive a couper du bois qu'il n'a pas posé , alors qu'il ne devrait pas pouvoir. Ma config: http://pastebin.com/hWdAWDbd
Merci d'avance de ton aide :)
@MrFresh54
File ta config en pastebin s'il te plait. :)
@Mastara
Essaie Ctrl+F "iProfessions" dans le fichier de log, et envoie ta config. :)
Bonjour Ptibiscuit :) , Je viens de découvrir ton Plugin , qui est pour moi l'un des meilleur ! Je commence donc la configuration mais voila , le plugin ne lis pas ma configuration , et me dis qu'il n'y a pas de jobs " detecté" , je ne comprend pas , il ne semble pas detecté d'erreur dans le config! Si tu pouvais m'aider a regler ce petit problème je t'en serais très reconnaissant :) merci d'avance
@MsPtibiscuit
Oui nous avons les plugins et de plus j'ai corrigé avec un ami toute les dernirère erreurs mais ça ne marche toujours pas! Voici notre log:
http://pastebin.com/qVgtHWZq
Merci d'avance :)
@Alterlif
Normalement, il devrait tourner, ce n'est pas parce qu'une version n'est pas taggée 1.3.1-R2.0 qu'elle ne tournera pas sous cette version, tout est une question de comptabilité, et certaines plugins passent les versions sans jamais défaillir.
@MrFresh54
Es-tu de n'avoir aucune erreur log ? Possèdes-tu bien Vault et PluginsBaker dans tes plugins ? Tu sais mettre ta config' dans un pastebin.org ? :)
Bonjour à tous,
j'ai découvert ce mod très très utile pour mon serveur il y a peu. Je me suis alors hâté à configurer mes métiers. Toutefois, il n'y a a aucun métier dans les logs (impossible de les voir / rejoindre). ET je tiens à préciser qu'il n'y a aucune erreur dans ma config. Voici ma config:
config:
max_profession: 3
profession_groups:
- max_profession: 1
professions:
- mineur
- forgeron
- armurier
- architecte
- max_profession: 1
professions:
- restaurateur
- aventurier
- alchimiste
- ingenieur
- enchanteur
- max_profession: 1
professions:
- tisseur
- bucheron
- policier
- eleveur
- agriculteur
players:
professions:
mineur:
name: Mineur
skills:
hasnot: Seul un mineur peut casser cela ...
dropItem:
- id: 1,4,14,15,16,19,21,56,73,74,87,88,89,110,341,348
smeltItem:
- id:4
hasnot: Seul un mineur ou un forgeron peut faire cela…
craftItem:
- id: 268,269,270,271
bucheron:
name: Bucheron
skills:
hasnot: Seul un bucheron peut faire cela ...
dropItem:
- id: 6,17
craftItem:
- id: 268,269,270,271
forgeron:
name: Forgeron
skills:
smeltItem:
- id: 4,14,15
hasnot: Tu ne peux pas faire cela...
craftItem:
- id: 256,257,258,268,269,270,271,273,274,275,277,278,279,284,285,286,290,291,292,293,294
hasnot: Seul un forgeron peut faire cela...
armurier:
name: Armurier
skills:
smeltItem:
- id: 14,15
hasnot: Tu ne peux pas faire cela...
craftItem:
- id: 261,262,268,269,270,271,298,299,300,301,306,307,308,309,310,311,312,313,314,315,316,316
hasnot: Seul un armurier peut faire cela...
agriculteur:
name: agriculteur
skills:
breakBlock:
- id: 59
hasnot: Seul un agriculteur peut faire cela...
craftItem:
- id: 268,269,270,271,335
hasnot: Seul un agriculteur peut faire cela...
placeBlock:
- id: 295,338,361,362
dropItem:
- id: 295,296,338,360,361,362
aventurier:
name: Aventurier
skills:
gainMoneyOnKIllCreature:
- type: CREEPER,SKELETON,SPIDER,GIANT,ZOMBIE,SLIME,GHAST,PIG_ZOMBIE,ENDERMAN,CAVE_SPIDER,ENDER_DRAGON
- reward: 50
craftItem:
- id: 268,269,270,271,246
dropItem:
- id: 40,287,288,289,341,
architecte:
name: Architecte
skills:
craftItem:
- id: 268,269,270,271
hasnot: Seul un architecte peut faire cela...
dropItem:
- id: 1,2,3,4,5,12,13
placeBlock:
- id: 17,24,25,26,35,41,42,43,44,45,47,48,50,54,57,58,61,62,63,64,65,67,68,78,79,80,84,85,86,91,96,97,98,102,107,108,109,268,269,270,271,321,328,333
hasnot: Seul un architecte peut faire cela...
policier:
name: Policier
restaurateur:
name: Restaurateur
skills:
smeltItem:
- id: 319,350,366
hasnot: Seul un restaurateur peut faire cela...
craftItem:
- id: 268,269,270,271,282,297,322,353,354,357
hasnot: Seul un restaurateur peut faire cela
ingerieur:
name: ingenieur
skills:
craftItem:
- id: 27,28,29,33,66,69,70,75,76,77,268,269,270,271,356
hasnot: Seul un ingenieur peut faire cela...
placeItem:
- id: 27,28,29,33,66,69,70,75,76,77,356
hasnot: Seul un ingenieur peut faire cela...
alchimiste:
name: Alchimiste
skills:
craftItem:
- id: 268,269,270,271,373,374,384
hasnot: Seul un alchimiste peut faire cela...
tisseur:
name: tisseur
skills:
craftItem:
- id: 268,269,270,271,351,35
hasnot: Seul un tisseur peut faire cela
dropItem:
- id: 37,38
eleveur:
name: Eleveur
skills:
gainMoneyOnKillCreature:
- id: PIG,SHEEP,COW,CHICKEN
- reward: 50
dropItem:
- id: 35,319,334,344,363,365
craftItem:
- id: 268,269,270,271,359
enchanteur:
name: Enchanteur
skills:
craftItem:
- id: 268,269,270,271
Merci d'avance pour votre soutient!!
@DarkfullDante
Il me semble que l'auteur parle en français.
J'ai entendu dire que le plugin ne tournait pas à cause de la non-mise à jour de pluginsbaker.
Le plugin tourne t-il chez vous?
Is brewing supported and cooking?
@Alterlif
Je vais surment être le seul à te comprendre, quand tu viens sur un site en anglais, le mieux c'est de poser la question dans la langue, mais il faudrait que tu envois ton fichier de config, pour voir l'erreur qu'il a
A dumb question for you: where does one find the names of the blocks/items/entities for the "key" field? I would just like a reference to look at when I am writing the values there, and some of the multi-word names could be written different ways. Thanks.
EDIT: Never mind, that was a really dumb question, since you said the answer in your post.
Bonjour,
Iprofessions marche à peu près sur mon serveur.
On peut rejoindre ou quitter un métier sans soucis.
Toutefois, je n'arrive pas à configurer les actions. Par exemple, le boulanger devrait être le seul à pouvoir faire du pain (craftItem), hors, tout le monde peut le faire.
Voici le pastbin: pastbin
En vous remerciant par avance pour toute aide.
J'ai essayé en alignant l'ID et le hasnot, en le décallant de deux, puis de quatre, rien à faire :(
Do you know if plugginbaker will eventually update, since we need it to make your pluggin function on 1.3.1