SulfurCubeArchetype 5.47.0
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
case BOUNCY = "bouncy"EXPLOSIVE
case EXPLOSIVE = "explosive"FAST_FLAT
case FAST_FLAT = "fast_flat"FAST_SLIDING
case FAST_SLIDING = "fast_sliding"HIGH_RESISTANCE
case HIGH_RESISTANCE = "high_resistance"HOT
case HOT = "hot"LIGHT
case LIGHT = "light"NONE
case NONE = "none"REGULAR
case REGULAR = "regular"SLOW_BOUNCY
case SLOW_BOUNCY = "slow_bouncy"SLOW_FLAT
case SLOW_FLAT = "slow_flat"SLOW_SLIDING
case SLOW_SLIDING = "slow_sliding"STICKY
case STICKY = "sticky"Methods
fromItem()
public static function fromItem(\pocketmine\item\Item $item) : ?selfReturns the archetype a sulfur cube takes when it absorbs this item, or null if it can't absorb it.
getAirDragModifier()
public function getAirDragModifier() : floatMultiplier of the air drag (minecraft:air_drag_modifier).
getBounciness()
public function getBounciness() : floatShare of the speed kept when bouncing off a block (minecraft:bounciness).
getFrictionModifier()
public function getFrictionModifier() : floatMultiplier of the friction of the block under the cube (minecraft:friction_modifier).
getHitHorizontalPower()
public function getHitHorizontalPower() : floatHorizontal power of a player's hit (player.json apply_knockback_rules horizontal_power).
getHitVerticalPower()
public function getHitVerticalPower() : floatVertical power of a player's hit (player.json apply_knockback_rules vertical_power).
getItemTag()
public function getItemTag() : stringBedrock item tag of the blocks giving this archetype.
getKnockbackResistance()
public function getKnockbackResistance() : floatminecraft:knockback_resistance: negative values make the cube fly further than a normal mob.
getPushScale()
public function getPushScale() : floatHow hard players push the cube by walking into it (push_scale_self of the "ball" pushable_by_entity preset).
getPushSoundCooldown()
public function getPushSoundCooldown() : intTicks between two pushed_by_player sounds (play_sound_cooldown_in_seconds).
getPushSoundThreshold()
public function getPushSoundThreshold() : floatSpeed above which a push plays the pushed_by_player sound (play_sound_impulse_threshold).
isBuoyant()
public function isBuoyant() : boolWhether the cube floats in water and lava (minecraft:buoyant).
modifyFriction()
public static function modifyFriction(float $friction, float $modifier) : floatVanilla friction formula with a modifier: 1 - (1 - friction) * modifier, clamped to 0-1.
