Skip to main content

Damage

Friendly Fire

Allows teammates to kill each other. Arrows will be absorbed if they hit a teammate.

<friendlyfire>on</friendlyfire> <!-- Defaults to off -->

Refunds arrows blocked by teammates from non-infinity bows.

<friendlyfirerefund>off</friendlyfirerefund> <!-- Defaults to on -->

Difficulty

The difficulty level can be set to peaceful, easy, normal, or hard. The default is hard.

<difficulty>easy</difficulty> <!-- Defaults to hard -->

Hunger

Specify if a player can starve to death, usually used with the difficulty setting. This can also be accomplished with the naturalRegeneration gamerule.

<hunger>
<depletion>off</depletion>
</hunger>

Damage Filtering

This module is used to filter when or if damage is applied to entities. Its contents can be a filter or combination of filters. It doesn't have to be <allow> and <deny> at the top level but that's usually what you want. Regions can also be used since they are filters that filter for a location.

Examples

<damage>
<deny>
<cause>explosion</cause>
</deny>
</damage>
<!-- Deny damage events where the attacker is on the red team -->
<damage>
<deny>
<attacker>
<team>red</team>
</attacker>
</deny>
</damage>
<!-- Deny fall damage for players using the Eagle class -->
<damage>
<deny>
<all>
<class>eagle</class>
<cause>fall</cause>
</all>
</deny>
</damage>

Disable Damage

Use this module to disable damage from specific causes.

While almost every form of damage can be disabled safely, it is recommended that you do not disable VOID damage.

Disable Damage Element

ElementDescription
<disabledamage> </disabledamage>Node containing the disabled damage types.
Sub-elementsValue/Children
<damage> </damage>The damage type that is disabled.Damage Cause

Damage Attributes

AttributeDescriptionValue
attacker-actionThe action to trigger for the attacker.Action ID
victim-actionThe action to trigger for the victim.Action ID

Example

<disabledamage>
<!-- Disable fall damage -->
<damage>fall</damage>
</disabledamage>
<!-- Deny explosions & use actions "when-attacking" and "when-damaged" -->
<damage attacker-action="when-attacking" victim-action="when-damaged">
<deny>
<cause>explosion</cause>
</deny>
</damage>

Block Explosion Attributes

The BLOCK_EXPLOSION damage cause has several extended attributes to customize who/what gets damaged. Only attributes with false as the value need to be explicitly defined since all attributes default to true.

AttributeDescriptionValueDefault
allyDamage to players on the same team as the person that caused the explosion.true/falsetrue
selfDamage to the person that caused the explosion.true/falsetrue
enemyDamage to players not on the same team as the person that caused the explosion.true/falsetrue
otherAny other damage caused by the explosion.true/falsetrue

Example

<disabledamage>
<!-- TNT damages enemies and self, but not teammates -->
<damage ally="true" self="false" enemy="false" other="false">block explosion</damage>
</disabledamage>

Damage Causes

The following damage causes can be used in the disable damage module. These causes do not need to be capitalized or contain underscores, i.e., FIRE_TICK and fire tick will both work.

NameDescription
CONTACTDamage caused when an entity contacts a block such as a Cactus.
ENTITY_ATTACKDamage caused when an entity attacks another entity.
PROJECTILEDamage caused when attacked by a projectile.
SUFFOCATIONDamage caused by being put in a block.
FALLDamage caused when an entity falls a distance greater than 3 blocks.
FIREDamage caused by direct exposure to fire.
FIRE_TICKDamage caused due to burns caused by fire.
MELTINGDamage caused due to a snowman melting.
LAVADamage caused by direct exposure to lava.
DROWNINGDamage caused by running out of air while in water.
BLOCK_EXPLOSIONDamage caused by being in the area when a block explodes.
ENTITY_EXPLOSIONDamage caused by being in the area when an entity, such as a Creeper, explodes.
VOIDDamage caused by falling into the void.
LIGHTNINGDamage caused by being struck by lightning.
SUICIDEDamage caused by committing suicide using the command /kill.
STARVATIONDamage caused by starving due to having an empty hunger bar.
POISONDamage caused due to an ongoing poison effect.
MAGICDamage caused by being hit by a damage potion or spell.
WITHERDamage caused by Wither potion effect.
FALLING_BLOCKDamage caused by being hit by a falling block which deals damage.
THORNSDamage caused in retaliation to another attack by the Thorns enchantment.
CUSTOMCustom damage.

Copied from: bukkit docs - Damage Cause