Skip to content

SulfurCubeArchetype 5.47.0 ​

enum · pocketmine\entity\animal\SulfurCubeArchetype · source

What a sulfur cube becomes when it absorbs a block (values of the actor property minecraft:sulfur_cube_archetype, in definition order). The block decides it through the Bedrock item tags minecraft:sulfur_cube_archetype_<name> (planks and logs: bouncy, stone: slow bouncy, TNT: explosive, magma: hot...). Physics values from the archetype component groups of sulfur_cube.json; the knockback taken from players from the apply_knockback_rules of player.json.

Cases ​

BOUNCY ​

php
case BOUNCY = "bouncy"

EXPLOSIVE ​

php
case EXPLOSIVE = "explosive"

FAST_FLAT ​

php
case FAST_FLAT = "fast_flat"

FAST_SLIDING ​

php
case FAST_SLIDING = "fast_sliding"

HIGH_RESISTANCE ​

php
case HIGH_RESISTANCE = "high_resistance"

HOT ​

php
case HOT = "hot"

LIGHT ​

php
case LIGHT = "light"

NONE ​

php
case NONE = "none"

REGULAR ​

php
case REGULAR = "regular"

SLOW_BOUNCY ​

php
case SLOW_BOUNCY = "slow_bouncy"

SLOW_FLAT ​

php
case SLOW_FLAT = "slow_flat"

SLOW_SLIDING ​

php
case SLOW_SLIDING = "slow_sliding"

STICKY ​

php
case STICKY = "sticky"

Methods ​

fromItem() ​

php
public static function fromItem(\pocketmine\item\Item $item) : ?self

Returns the archetype a sulfur cube takes when it absorbs this item, or null if it can't absorb it.

getAirDragModifier() ​

php
public function getAirDragModifier() : float

Multiplier of the air drag (minecraft:air_drag_modifier).

getBounciness() ​

php
public function getBounciness() : float

Share of the speed kept when bouncing off a block (minecraft:bounciness).

getFrictionModifier() ​

php
public function getFrictionModifier() : float

Multiplier of the friction of the block under the cube (minecraft:friction_modifier).

getHitHorizontalPower() ​

php
public function getHitHorizontalPower() : float

Horizontal power of a player's hit (player.json apply_knockback_rules horizontal_power).

getHitVerticalPower() ​

php
public function getHitVerticalPower() : float

Vertical power of a player's hit (player.json apply_knockback_rules vertical_power).

getItemTag() ​

php
public function getItemTag() : string

Bedrock item tag of the blocks giving this archetype.

getKnockbackResistance() ​

php
public function getKnockbackResistance() : float

minecraft:knockback_resistance: negative values make the cube fly further than a normal mob.

getPushScale() ​

php
public function getPushScale() : float

How hard players push the cube by walking into it (push_scale_self of the "ball" pushable_by_entity preset).

getPushSoundCooldown() ​

php
public function getPushSoundCooldown() : int

Ticks between two pushed_by_player sounds (play_sound_cooldown_in_seconds).

getPushSoundThreshold() ​

php
public function getPushSoundThreshold() : float

Speed above which a push plays the pushed_by_player sound (play_sound_impulse_threshold).

isBuoyant() ​

php
public function isBuoyant() : bool

Whether the cube floats in water and lava (minecraft:buoyant).

modifyFriction() ​

php
public static function modifyFriction(float $friction, float $modifier) : float

Vanilla friction formula with a modifier: 1 - (1 - friction) * modifier, clamped to 0-1.

VanillaMine is a fork of PocketMine-MP. Not affiliated with the PMMP team or Mojang.