Skip to content

Mooshroom 5.46.0 ​

class · pocketmine\entity\animal\Mooshroom · source

Extends Cow

Bedrock values (entities/mooshroom.json): a cow (10 health, 0.9x1.3, movement 0.25, bred with wheat, milked with a bucket) that is red (VARIANT 0) or brown (1). A bowl gives mushroom stew; a brown mooshroom fed a flower gives one suspicious stew of that flower next (MARK_VARIANT = the flower, -1 for none). Shears turn it into a cow and drop 5 mushrooms of its colour. Two mooshrooms of the same colour have a 1/1024 chance of a baby of the other colour. Loot (loot_tables/entities/mooshroom.json): 0-2 leather and 1-3 beef (cooked when burning), +0-1 each per Looting level. Lightning switches the colour (red <-> brown).

Constants ​

TAG_STEW_FLOWER ​

php
public const TAG_STEW_FLOWER = "MarkVariant"

TAG_VARIANT ​

php
public const TAG_VARIANT = "Variant"

VARIANT_BROWN ​

php
public const VARIANT_BROWN = 1

VARIANT_RED ​

php
public const VARIANT_RED = 0

Methods ​

createBaby() protected ​

php
protected function createBaby(\pocketmine\entity\animal\Animal $partner, \pocketmine\entity\Location $location) : \pocketmine\entity\animal\Animal

getName() ​

php
public function getName() : string

getNetworkTypeId() ​

php
public static function getNetworkTypeId() : string

getVariant() ​

php
public function getVariant() : int

initEntity() protected ​

php
protected function initEntity(\pocketmine\nbt\tag\CompoundTag $nbt) : void

onInteractWithItem() protected ​

php
protected function onInteractWithItem(\pocketmine\player\Player $player, \pocketmine\item\Item $item) : bool

onStruckByLightning() ​

php
public function onStruckByLightning(\pocketmine\entity\object\LightningBolt $bolt) : void

Vanilla: lightning turns a red mooshroom brown and a brown one red (once per bolt), without hurting it.

saveNBT() ​

php
public function saveNBT() : \pocketmine\nbt\tag\CompoundTag

setVariant() ​

php
public function setVariant(int $variant) : void

shear() ​

php
public function shear() : ?\pocketmine\entity\animal\Cow

Turns the mooshroom into a cow, dropping 5 mushrooms. Returns the cow, or null if it can't be sheared now.

stewTypeForFlower() ​

php
public static function stewTypeForFlower(\pocketmine\item\Item $item) : ?\pocketmine\item\SuspiciousStewType

Suspicious stew kind given by a flower item, or null if it isn't one.

syncNetworkData() protected ​

php
protected function syncNetworkData(\pocketmine\network\mcpe\protocol\types\entity\EntityMetadataCollection $properties) : void

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