Position
About 1236 wordsAbout 4 min
Every company has two built-in positions, employer and employee, plus a number of custom positions. Each position has the following properties:
- an id — the identifier used in commands, for example
manager - a label — the display name shown in menus and messages
- a salary — paid to its members every day
- a set of position permissions — what its members are allowed to do in the company
The maximum number of custom positions is configured in config.yml. The value excludes employer and employee, so the default value of 5 allows 7 positions in total.
company-settings:
# The maximum amount of custom position that
# the company can have.
# The value is excluding employer and employee.
maximum-position: 5Built-in positions
| Id | Description |
|---|---|
employer | The owner of the company. Has the ALL permission by default. Cannot be removed, and cannot be given to another player through /myc position set. |
employee | The default position of a hired player. Also receives the members of a removed custom position. Gets the permissions configured in employee-default-permission. |
Both built-in positions can be renamed, but their ids never change.
Create a custom position
Players whose position has the POSITION_ADD permission can add a custom position. They can do it in the menu, or execute:
/myc position add <position> [label]<position>is the id of the new position. Ids are case-sensitive and must be a single word.[label]is optional. If it is omitted, the id is used as the label. The label is also a single word and is stored exactly as typed.
For example:
/myc position add manager Manager
/myc position setlabel manager Sales_ManagerThe first command creates a position with the id manager and the label Manager. The second command renames it to Sales Manager, because /myc position setlabel converts _ into a space. If you add a position in the menu, only the id is asked for; the label starts as the id and can be changed afterwards.
A newly created position starts with:
- no members
- the label equal to its id
- the salary
500.0 - the permissions listed in
company-settings.employee-default-permission
When the company already has the maximum number of positions, the creation is refused.
Remove a custom position
Players whose position has the POSITION_REMOVE permission can remove a custom position. They can do it in the menu, or execute:
/myc position remove <position>employer and employee cannot be removed. The label, salary and permissions of the removed position are deleted, and its former members are moved to employee.
Set an employee's position
There is no fixed promote/demote chain in MyCompany, because the positions are completely customizable. Players whose position has the SET_POSITION permission can change the position of another member:
/myc position set <player> <position>The operation fails when:
- the target is not a member of the same company
- the target is yourself
- the position is
employer(the employer is not transferred this way) - the target already has the given position
- the player executing the command is not the employer, and the target's current position has the
SET_POSITION(orALL) permission — this prevents members from moving each other at the same level
The permissions of the target change immediately, and an online target is notified about the change. The same can be done in the Personnel menu.
Rename a position
Labels are only for display; commands always use the id. Players whose position has the POSITION_SETLABEL permission can rename a position:
/myc position setlabel <position> <label>Underscores in <label> are converted into spaces, so Sales_Manager becomes Sales Manager. Only the employer can rename the employer position.
Set the salary of a position
Only the employer can set the salary:
/myc position setsalary <position> <amount><amount> must be a whole number that is greater than or equal to 0. The salary is paid to every member of the position every day, together with the "government" sponsorship. See Company funds for the payment details.
Tips
The command checks the mycompany.commands.position.setsalary command permission before running. If your permission plugin denies it, grant that node to the player.
Position permissions
MyCompany has its own permission system for positions, so each company can decide what its positions are allowed to do. Permissions are stored per company: the same position id can have different permissions in two different companies.
Tips
Command permissions (mycompany.commands.*) are not the main permission system of this plugin. You should prefer the position permissions described on this page. See Permissions.
The employer can give or remove permissions of any position. The default permission of the employer is ALL, which means every position permission. The default permissions of the employee are configured in config.yml:
Default permissions for new positions
company-settings:
# Default permissions given to the employee
# Custom position will also follow this default setting.
employee-default-permission:
- 'CHESTSHOP_CREATE'
- 'CHESTSHOP_DELETE'Every new custom position copies this list when it is created. Changing the list does not affect positions that already exist.
How to set the permissions of a position
In commands (employer only):
/myc position permission add <position> <permission>— give a permission to the position/myc position permission remove <position> <permission>— remove a permission from the position/myc position permission list— list all permissions that the plugin provides/myc position permission list <position>— list the permissions that the position has
Permission ids are case-insensitive, so employ and EMPLOY are the same.
In menu:
- Execute
/myc opento open the company menu, then open Position. - Left click a position to change its label.
- Shift + left click a position to open its permission list.
- Shift + right click a position to remove it.
- In the permission list, click a permission to enable or disable it. Enabled permissions are marked as permitted.
- The
ALLpermission can only be given or removed by the employer, and the permissions of theemployerposition can only be changed through commands.
Removing a permission takes effect immediately: members of the position lose access to the related function right away.
Permission list
| Id | Label | Description |
|---|---|---|
ALL | All permissions | Every permission of the company. The employer has it by default. |
EMPLOY | Employ | Employ a player to the company. |
FIRE | Fire | Fire an employee from the company. Giving it to a non-employer position may leave the company empty. |
SET_POSITION | Set Position | Set the position of an employee. |
POSITION_ADD | Position Adding | Add a new position to the company. |
POSITION_REMOVE | Position Removing | Remove a position from the company. |
POSITION_SETLABEL | Position Label Setting | Set the label of a position. |
POSITION_SETPERMISSION | Position Permission Setting | Set the permissions of a position in the menu. |
CHESTSHOP_CREATE | Chestshop Creation | Create a chestshop for the company. |
CHESTSHOP_DELETE | Chestshop Removing | Remove a chestshop of the company. |
AREA_CREATE | Company Area Creation | Create a company area. |
AREA_DELETE | Company Area Deleting | Delete a company area. |
AREA_SETLOC | Location Set of Company Area | Set the teleport location of a company area. |
AREA_MARKET_RENT | Pushing Area to Rent Market | Push a company area to the rent market. |
AREA_MARKET_SELL | Pushing Area to Sale Market | Push a company area to the sale market. |
AREA_RENT | Area Rent | Rent an area from the area rent market. |
AREA_BUY | Area Purchase | Purchase an area from the area sale market. |
FOCUS_SET | Focus Setting | Choose the focus of the company. |
FOCUS_LEARN_EXPERTISE | Expertise Learning | Learn expertises in the focus tree of the company. |
The two focus permissions control the Focus menu.