大家好,
iProfessions 是一个完整的插件,用于为你的服务器打造基于职业的经济系统。玩家将获得一个职业(矿工、铁匠……随你定义),并且只有拥有该职业的玩家才能执行某些特定操作。例如,如果你创建了一个“铁匠”职业并赋予其制作技能,那么只有铁匠玩家才能制作武器、铲子等物品。
当然,你可以自定义自己的职业,这些并非预设的职业。iProfessions 力求让职业尽可能高度可定制:你可以为其分配制作技能、破坏方块技能、使用物品技能以及其他多种技能。
它还提供了更多功能,如职业分支(对职业进行专精化)、经济支持、学习职业所需的条件等。
最后一点,你可以将 iProfessions 与 BeardStat 配合使用,以实现所需的功能(例如要求玩家在获得某项工作前必须先完成某些行为)。
希望你能喜欢这个插件,如果你的服务器玩家众多且希望构建真实的基于职业的经济体系,它将非常有用。 :)
/!\ 此插件 需要 PluginsBaker 才能正常运行,别忘了安装它! :)
使用方法
配置
打开 config.yml,其中包含三个部分。玩家数据会自动填充。
配置文件中包含以下设置:
- max_profession: 每个玩家最多可以拥有的职业数量。
职业的配置稍微复杂一些,页面末尾附有如何创建职业的教程,希望能帮助你理解。 :P
命令
- /plearn <职业标签> (iprofessions.learn.<Tag>): 学习一个职业。此命令的权限根据职业不同而变化。如果玩家想要学习“矿工”职业,则需要拥有权限 "iprofessions.learn.miner"。
- /pforget <职业> (iprofessions.forget): 遗忘其中一个职业。
- /paddprofuser <玩家> <职业标签> (iprofessions.user.profession.add): 为玩家添加一个职业。
- /premprofuser <玩家> <职业标签> (iprofessions.user.profession.remove): 移除玩家的某个职业。
- /pwhois [玩家] (iprofessions.whois.other): 显示其他玩家的工作职业。
- /pwhois (iprofessions.whois.self):显示你的职业。
- /plist <Profession> (iprofessions.list):显示所有拥有该职业的在线玩家列表。
还有一些特殊的权限:
- iprofessions.god:允许玩家执行任何操作,即使他们没有正确的职业。
创建你的职业——分步教程
哎呀,我会尽量让这个教程尽可能清晰易懂。首先,这里有一个现成的 YAML 配置文件模板,用于创建你的职业:
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]
在本教程中,我们将创建一个铁匠职业(在查看底部结果的同时阅读这些操作):
该职业的tag将设为 blacksmith,这意味着玩家必须使用 "/plearn blacksmith" 来学习这个职业。
职业的name将设为 "Blacksmith",此字段是职业的大写名称,包含空格等。
price是玩家需要支付以学习该职业的费用。我选择学习铁匠职业需要花费 150 iConomy 货币。
parent 字段比较特殊,将在下文进行说明。它在构建职业树时非常有用。对于我的铁匠,我将删除这个字段。:)
Required 字段包含学习该职业所需的所有条件。对于我们的职业,除了支付 150 iConomy 货币外,玩家还需要已经破坏 15 个石头方块和 10 个煤炭方块。Hasnot 字段会在玩家未满足 required 字段的条件时显示。(“{LEFT}”将被替换为完成所需操作剩余的次数(需要破坏 15 个方块,我已经破坏了 10 个,{LEFT} = 5 :P ))
Required 字段由 BeardStat 插件处理(你可以不使用 BeardStat 而仅使用 iProfessions,但这样你就无法使用 required 字段)。
在本教程的这一部分,我们的职业配置如下:
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 ....
现在,配置中最重要的部分是技能!
当你给一个职业赋予技能时,只有属于该职业的玩家才拥有此技能并能够执行技能所允许的操作。对于我们的职业,只有铁匠可以合成金工具和钻石工具(铲子、剑、斧头……),挖掘金矿石和铁矿石,并熔炼这些矿石。与 required 字段类似,当玩家尝试执行其没有相应职业权限的操作时,会显示 hasnot 字段。以下是我们铁匠职业的完整配置:
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 ? ...
这里有很多类型的技能。我们刚才只使用了其中三种,但你可以在下方找到所有技能类型的列表。
你还可以指定元数据,例如羊毛("35-4", "35-14" ...)或楼梯。
如果你想要更多示例,以了解如何构建复杂的职业结构,你可以查看Free sample,我会尝试创建许多示例。:)
技能类型
| 标签 | 用途 | 配置示例 |
| craftItem | 允许合成物品 | id: 257 hasnot: You can't craft that. |
| smeltItem | 允许玩家将物品放入熔炉的熔炼槽 | id: 14,15 hasnot: You can't smelt that. |
| breakBlock | 允许玩家破坏特定类型的方块(在同一服务器实例期间,所有玩家都能破坏由其他玩家放置的方块(如果重新加载或重启服务器,玩家将无法破坏那些被放置的方块)。) | id: 1 hasnot: You can't break that. |
| placeBlock | 允许玩家放置特定类型的方块 | id: 2 hasnot: You can't place that block. |
| gainMoneyOnBreakBlock | 玩家在破坏方块时会获得金钱(通过自己放置的方块不会获得金钱) | id: 1 reward: 1 |
| gainMoneyOnKillCreature | 玩家在击杀生物时会获得金钱。(所有生物类型的列表在此处) | type: PIG,CREEPER reward: 50 |
| dropItem | 允许玩家在破坏物品时接收掉落物。 | id: 1,5,2 |
| wearItem | 允许玩家穿戴物品(头盔、靴子……) | id: 306 hasnot: You can't wear that |
构建职业(专精)树
你可以为职业设置专精,这些职业将获得其父级职业的技能和自身拥有的技能。此外,学习其中一种职业需要先学会其父级职业。例如,我想创建 2 种职业:
矿工,玩家首先必须学会这个职业。矿工可以挖掘铁矿石和红石矿石。
然后,玩家可以在以下两种职业中进行选择:
金矿矿工,他们拥有矿工的所有技能以及挖掘金矿石的技能。
钻石矿工,我想你已经明白其中的逻辑了,他们拥有矿工的技能以及挖掘钻石矿石的技能。
下面是一个简单的示意图来解释这种情况:

以下是创建这类职业的配置文件:
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.
注意为 gold_miner 和 diamond_miner 职业添加了 "parent: miner" 字段。
最后一点,你必须在父级职业之后编写子职业!
构建职业组
这是另一个功能,允许你强制玩家选择特定的职业组合。例如:
假设我正在尝试制作一个类似《魔兽世界》的服务器。在《魔兽世界》中,基本上有两种职业:制造类和农业类。农业类职业就像矿工、草药师、剪毛工等……制造类职业就像铁匠、裁缝、炼金术士等……
在我的服务器中,我有 6 种职业:矿工、草药师、伐木工、铁匠、炼金术士和工程师。前三种是我的“农业”职业,后三种是我的“制造”职业。:)
在我的服务器中,玩家可以学习 2 种职业,但是,我希望他们只能学习 1 种农业职业和 1 种制造职业。
好吧,使用 iProfessions,这是可能的!:D
进入你的配置文件,找到 "professions_group" 节点。默认情况下,你有以下内容:
config:
max_profession: 2
profession_groups:
- max_profession: 1
professions:
- farmer
- miner
如果你什么都没有,请尝试通过删除当前配置文件(别忘了先备份 ;X)并重新加载插件来生成新的配置文件。
对于我的服务器,我将创建 2 个组,将每个组的 max_profession 设置为 1,并列出我所有的“农业”职业和“制造”职业。
结果如下:
config:
max_profession: 2
profession_groups:
- max_profession: 1
professions:
- lumberjack
- miner
- herborist
- max_profession: 1
professions:
- blacksmith
- tailor
- alchemist
从逻辑上讲,你所有组的 "max_profession" 之和应该等于配置中的全局 "max_profession"。(这里,1+1=2)
/!\ 最后一点,如果你在使用专精(设置职业树),你组中的 "professions" 节点必须只包含根职业(没有父级的职业)。
将组链接到职业
如果你希望当玩家学习某个职业时,他会被添加到一个组中,那么 linked_group 就是为你准备的!:P
要配置链接组,只需向职业的配置中添加以下内容:
professions:
miner:
name: Mineur
linked_group: miner
price: 50
...
当玩家学会 "miner" 职业时,他将被添加到 "miner" 组中。当他忘记或专精 "miner" 职业时,他将被移除。
/!\ 如果你使用 linked_group 功能,你就不能通过修改文件来更改玩家的职业,因为这会导致组和职业不同步!
所需类别列表
在本教程中,我们使用了 “blockdestroy” 分类,但实际上还有更多。实际上并没有所有有效类别键的列表,因为这是由 BeardStat 管理的。如果你将配置转换为数据库,你可以轻松检查你的数据库以查看所有可能的类别。这里是我数据库中的一些示例。:)
| Category | Key | Description |
| blockdestroy | iron, dirt, ironore, stone, ... | 被破坏的方块,我认为不需要进一步解释 :P |
| itempickup | sapling, dirt, ... | 同上 |
| crafting | wood, ... | 这是合成物品 |
| blockcreate | ironore, ... | 放置而非合成的物品! |
| deaths | total, fall, ... | 死亡次数 |
| stats | chatletters, chat, login, move, playedfor, firstlogin, lastlogin, lastlogout, totalblockcreate, totalblockdestroy, damagehealed, move, | 这些是独立统计项 |
| kills | skeleton, spider, total, ... | 击杀人数 |
| damagetaken | fall, arrow, skeleton, total,... | |
| damagedealt | arrow, skeleton, entityattack, ... | |
| itemdrop | wood, ... | |
| exp | currentexp (当前等级), lifetimeexp() | |
| | |
使用告示牌执行操作
你可以创建告示牌,当玩家与之交互时触发特定操作。
很简单,在告示牌的第一行写上 “[iProfessions]”。
第二行则取决于你想要告示牌执行的操作:
- learn <tag's profession>:效果与 "/plearn" 完全相同,尝试学习一个职业(权限:iprofessions.sign.learn.<Tag>)。例如,通过告示牌学习 "miner" 职业的权限为 "iprofessions.sign.learn.miner"。
- forget <tag's profession>:效果与 "/pforget" 完全相同。使用该告示牌所需的权限为 iprofessions.sign.forget.<Tag>
- 未来可能还有其他操作。:)
如果还没明白的话,举个例子: :P

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 ! :)
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

评论 0
登录后参与评分
还没有评论,来抢沙发吧