Skip to content

Mace 5.46.0 ​

class · pocketmine\item\Mace · source

Extends Tool

A heavy weapon whose smash attack (hitting while falling) deals more damage the further the attacker fell.

Vanilla (https://minecraft.wiki/w/Mace): 6 attack damage, 500 durability on Java and 501 on Bedrock, repaired with breeze rods, enchantability 15, no attack cooldown on Bedrock. Smash attack: when falling more than 1.5 blocks, +4 damage per block for the first 3 blocks, +2 per block for the next 5 and +1 per block beyond that; Density adds 0.5 per block per level. A smash resets the attacker's fall distance and knocks back entities around the target; Wind Burst then launches the attacker. Unlike Java, Bedrock also smashes while gliding with an elytra; creative flight doesn't fall, so it never smashes.

Constants ​

BREACH_ARMOR_REDUCTION_PER_LEVEL ​

php
public const BREACH_ARMOR_REDUCTION_PER_LEVEL = 0.15

Breach: armor effectiveness lost per level (15 percentage points).

HEAVY_SMASH_FALL_DISTANCE ​

php
public const HEAVY_SMASH_FALL_DISTANCE = 5.0

Fall distance above which the smash is "heavy" (stronger area knockback, heavy sound).

SMASH_KNOCKBACK_RADIUS ​

php
public const SMASH_KNOCKBACK_RADIUS = 3.5

Radius around the target in which other entities are knocked back by a smash (Java MaceItem).

SMASH_MIN_FALL_DISTANCE ​

php
public const SMASH_MIN_FALL_DISTANCE = 1.5

WIND_BURST_RADIUS ​

php
public const WIND_BURST_RADIUS = 3.5

Wind Burst: burst radius (Java WindBurst enchantment effect).

Methods ​

calculateSmashDamageBonus() ​

php
public static function calculateSmashDamageBonus(float $fallDistance, int $densityLevel = 0) : float

Returns the damage a smash attack adds for the given fall distance and Density level.

calculateSmashKnockback() ​

php
public static function calculateSmashKnockback(float $distance, float $fallDistance, float $knockbackResistance = 0.0) : float

Returns the velocity added to an entity at the given distance from the smash target (0 if out of range).

canSmashAttack() ​

php
public function canSmashAttack(\pocketmine\player\Player $attacker) : bool

Returns whether an attack made now by the player is a smash attack.

getArmorEffectivenessReduction() ​

php
public function getArmorEffectivenessReduction() : float

Returns the fraction of armor effectiveness the target loses against this mace (Breach).

getAttackPoints() ​

php
public function getAttackPoints() : int

getEnchantability() ​

php
public function getEnchantability() : int

getMaxDurability() ​

php
public function getMaxDurability() : int

getWindBurstMultiplier() ​

php
public function getWindBurstMultiplier() : float

Returns the Wind Burst knockback multiplier, or 0 if the mace doesn't have Wind Burst.

isValidRepairMaterial() ​

php
public function isValidRepairMaterial(\pocketmine\item\Item $item) : bool

Returns whether the given item can repair this mace in an anvil.

onAttackEntity() ​

php
public function onAttackEntity(\pocketmine\entity\Entity $victim, array &$returnedItems) : bool

onDestroyBlock() ​

php
public function onDestroyBlock(\pocketmine\block\Block $block, array &$returnedItems) : bool

onSmashAttack() ​

php
public function onSmashAttack(\pocketmine\player\Player $attacker, \pocketmine\entity\Entity $target, float $fallDistance) : void

Called after a smash attack hit: knocks back the entities around the target (not the attacker) and applies Wind Burst.

VanillaMine is a fork of PocketMine-MP, maintained by Luxury Nodes. Not affiliated with the PMMP team or Mojang.