Kits
Kits are groups of items and effects that can be given to players in various ways. here are many types of kits, and they can be packaged together in any combination.
Kits can be given an id
attribute, which is used to refer to them in other places.
Kits can contain other kits directly, and can also inherit items from other kits through the parents=""
attribute.
Some types of kits are removable, meaning that the kit can be automatically taken from the player as well as given. When used in certain contexts, these kits will be automatically removed from the player at an appropriate time. These can be used in Dynamic Kits. Removable kits will be noted in the documentation where applicable.
Kit Element
Element | Description |
---|---|
<kit> </kit> | A kit node, containing specific kit types and/or other kit nodes. |
Kit Attributes
Attribute | Description | Value | Default |
---|---|---|---|
id | Unique identifier used to reference this kit from other places in the XML. | String | |
filter | PropertyFilter when this kit is used. | Filter | |
parents | The kit's parent or a comma separated list of parent kits. | String | |
force | Force apply the kit, which will override existing items in certain slots. | true/false | |
overflow-warning | Warn the player when the kit cannot give the player all of its items. Defaults to standard translatable message | String | |
repair-tools | Repairs tools in the player's inventory with those given in the kit. | true/false | true |
deduct-tools | Deducts the toolrepair given in the kit by the toolrepair in the player's inventory. | true/false | true |
deduct-items | Deducts the number of items given in the kit by the number of items the player already has. | true/false | true |
drop-overflow | Drops overflow items on the ground near the player. | true/false | false |
potion-particles | Enable or disable potion particles. Potion particles are disabled for all players by default. | true/false | false |
reset-ender-pearls | Reset any ender pearls the player might have thrown before the kit was applied. | true/false | false |
The effect of the force
attribute depends on the type of kit it is used with:
conflicting items or armor will be replaced instead of smartly merged and repaired,
health and hunger will be set instead of only increased,
and potion effects can be replaced with the same effect at a lower level or shorter duration.
<kits>
<kit id="spawn-kit" force="true">
<item slot="0" material="iron sword"/>
<item slot="8" amount="32" material="bread"/>
<effect duration="5">instant_health</effect>
</kit>
<kit id="red-kit" parents="spawn">
<helmet color="cd0000" material="leather helmet"/>
</kit>
<kit id="blue-kit" parents="spawn">
<helmet color="0066cc" material="leather helmet"/>
</kit>
</kits>
In the example above players from blue team will get a blue helmet, players from red team will get a red helmet; both teams will get the items from the spawn kit. The spawn kit contains a 5 second healing potion to help prevent spawn killing.
Item & Armor Kits
Kits can place items in specific slots of a player's inventory, and equip them with armor. See Items & Armor for details.
Item kits will replace any items in the player's inventory in slots present in the kit, but they will not alter any other slots.
If you want to guarantee that a slot is empty, put an item called "air" in that slot.
You can also clear the player's entire inventory before applying the kit by using the <clear/>
element.
Inventory Clear Elements
Element | Description |
---|---|
<clear/> | Clears all of the player's inventory, including armor slots. |
Inventory Clear Attributes
Attribute | Description | Value | Default |
---|---|---|---|
items | Clears all of the player's inventory, except armor slots. | true/false | true |
armor | Clear's all of the player's armor slots. | true/false | true |
effects | Clears all of the player's current potion effects. | true/false | false |
<kit id="ender" reset-ender-pearls="true">
<item slot="0" amount="4" material="ender pearl"/>
<!-- clears items and armor slots by default -->
<clear/>
</kit>
Game-mode Kit
A player's gamemode can be changed when they spawn, enter or leave a region, etc., by applying a kit with a game-mode
element.
This is not to be confused with Map Gamemode <gamemode>
, which controls how PGM should display a map.
Element | Description | Value |
---|---|---|
<game-mode> </game-mode> | The gamemode to change the player to. | Game Mode String |
<game-mode>adventure</game-mode>
Health & Hunger Kits
A player's health and hunger can be modified with kits, this can be useful on maps with the naturalRegeneration
gamerule set to false.
By default health or hunger values are only increased, not decreased.
For example, a player with 5 hearts (10 points) will not get a 5 health point kit applied,
however a 20 point kit will be applied. This can be overwritten with a kit force="true"
attribute.
Health & Hunger Elements
Element | Description | Value |
---|---|---|
<health> </health> | Health value in ½ heart increments. | 1 - 20 |
<max-health> </max-health> | The maximum health a player can have. | >1 |
<saturation> </saturation> | Food saturation, always equal to or less than the player's food level. | Decimal |
<foodlevel> </foodlevel> | Food level in ½ drumstick increments. | 0 - 20 |
<kit id="health" force="true">
<health>10</health>
</kit>
<kit id="max-health-kit" force="true">
<!-- Double health, default is 20 -->
<max-health>40</max-health>
</kit>
<kit id="hunger">
<saturation>20</saturation>
<foodlevel>20</foodlevel>
</kit>
Team Switch Kit
Allow for players who receive this kit to be forced onto a different team.
Element | Description |
---|---|
<team-switch/> | Switch the player's current team. |
Team Switch Kit Attributes
Attribute | Description | Value | Default |
---|---|---|---|
team | The new team to switch the player to. | Team ID | |
show-title | Set if the player should recieve join message as a title. | true/false | true |
<kit id="team-switch">
<team-switch team="blue-team" show-title="false"/>
</kit>
Dynamic Kits
Kits that are removable can be given and taken dynamically by using a Dynamic Filter.
Element | Description | Value |
---|---|---|
<give> | Gives a kit to a player when they match the filter. | Dynamic Filter |
<take> | Removes a kit when they match the filter. | Dynamic Filter |
<lend> | Loans a player a kit when the filter is ALLOW , removes when they stop matching the filter. | Dynamic Filter |
<kits>
<!-- Kit and Filter References -->
<lend kit="jumper-kit" filter="carrying-gold"/>
<give kit="regen-kit" filter="holding-redstone"/>
<!-- Player can no longer fly after carrying the flag -->
<take>
<kit>
<fly/>
</kit>
<filter>
<flag-carried>flag</flag-carried>
</filter>
</take>
</kits>
Potion Effect Kits (removable)
Potion effects can be applied and removed with a kit.
See Potion Effects for details about the <effect>
element.
<kit>
<effect duration="10" amplifier="4">resistance</effect>
</kit>
Attribute Modifier Kits (removable)
Attribute modifiers can be applied directly to players through a kit. Modifying attributes in this way, instead of through an item, is a simple way to ensure that the player cannot avoid the effect of the modifier. See Attribute Modifiers to learn how they are applied to items.
The only way to remove an attribute modifier applied to a player is by removing the kit that applied it. A kit cannot affect a modifier applied by a different kit.
Attribute Operations
add
— Add amountbase
— Multiply amount by base value and add itmultiply
— Multiply by amount
Attribute Kit Elements
Element | Value |
---|---|
<attribute> </attribute> | Attribute Name |
Attribute Kit Attributes
Attribute | Description | Value | Default |
---|---|---|---|
amount | Numeric parameter | Decimal | |
operation | Modifier operation | add / base / multiply | add |
<kit>
<attribute operation="add" amount="0.5">generic.movementSpeed</attribute>
</kit>
Walk Speed Kit (removable)
Increase or decrease a player's walking speed. The value is a multiplier of the normal walking speed.
Element | Description | Value |
---|---|---|
<walk-speed> </walk-speed> | Increase or decrease a player's walking speed. | 0 - 5.0 |
<kit id="rabbit">
<!-- 1.8 times faster than a normal player -->
<walk-speed>1.8</walk-speed>
</kit>
<kit id="tortoise">
<!-- half as fast as a normal player -->
<walk-speed>0.5</walk-speed>
</kit>
Knockback Reduction Kit (removable)
Reduce (or increase) the knockback players receive when they have this kit applied.
The normal input range is 0 - 1.0
. If the value is greater than one the knockback will be increased,
and anything lower than zero pushes the player to the attacker instead of away from them.
Element | Description | Value |
---|---|---|
<knockback-reduction> </knockback-reduction> | Knockback reduction amount. | Number |
<kit>
<knockback-reduction>0.5</knockback-reduction>
</kit>
Shield Kit (removable)
The shield kit gives the player a shield consisting of absorption hearts that recharge after a set period of time. Recharging of the shield is based on when damage was taken last, every time a player is damaged it resets the recharge timer.
Element | Description |
---|---|
<shield/> | Give the player a rechargable shield of absorption hearts. |
Shield Kit Attributes
Attribute | Description | Value | Default |
---|---|---|---|
health | Amount of extra absorption hearts to give to the player. | Decimal | 4 |
delay | Time to wait after a player is last damaged to recharge the shield. | Time Period | 4s |
<kit>
<shield health="4" delay="8s"/>
</kit>
Double Jump Kit (removable)
Give players with this kit the ability to double-jump. This element's enabled attribute can be used to disable double-jump inside regions, etc.
Element | Description |
---|---|
<double-jump/> | Give a player the ability to double-jump. |
Double-Jump Attributes
Attribute | Description | Value | Default |
---|---|---|---|
enabled | Enable or disable double-jump. | true/false | true |
power | Power of the double jump. A normal player jump is 1.25 blocks. | Number | 3 |
recharge-time | Recharge time until the player can double jump again. | Time Period | 2.5s |
recharge-before-landing | Player starts recharging before they land from their previous jump. | true/false | false |
<kit>
<double-jump recharge-before-landing="true"/>
</kit>
Fly Kit (removable)
The fly kit gives players which it is applied to the ability to fly.
It also allows modification of the speed at which they fly.
If no attributes are specified, can-fly
defaults to true.
Element | Description |
---|---|
<fly/> | Control the player's flying ability. |
Fly Kit Attributes
Attribute | Description | Value | Default |
---|---|---|---|
can-fly | Set if the player can fly. | true/false | true |
flying | Set if the player is currently flying. To enable flying, can-fly cannot be set to false. | true/false | |
fly-speed | Set the fly speed multiplier. | 0 - 10 | 1 |
<kit id="fly">
<fly/> <!-- Allow player to fly -->
<fly can-fly="false"/> <!-- Do not allow player to fly -->
<fly flying="true"/> <!-- Make the player fly right away -->
<fly flying="false"/> <!-- Make the player stop flying right away -->
</kit>