Skip to content

RaiderTrait 5.46.0 ​

trait · pocketmine\entity\monster\RaiderTrait · source

Implementation of Raider. The using class must call RaiderTrait::loadRaiderData(), RaiderTrait::saveRaiderData(), RaiderTrait::syncRaiderData() and RaiderTrait::registerRaiderGoals() from initEntity(), saveNBT(), syncNetworkData() and registerGoals().

Captains wear the ominous banner in the chest armor slot, which is where Bedrock puts it (Java uses the head).

Methods ​

canBePatrolLeader() ​

php
public function canBePatrolLeader() : bool

canDespawn() ​

php
public function canDespawn() : bool

Raiders taking part in a raid never despawn until the raid is over (vanilla).

getPatrolTarget() ​

php
public function getPatrolTarget() : ?\pocketmine\math\Vector3

getRaidCenter() ​

php
public function getRaidCenter() : ?\pocketmine\math\Vector3

getRaidId() ​

php
public function getRaidId() : ?int

getRaidWave() ​

php
public function getRaidWave() : int

getRaiderDrops() protected ​

php
protected function getRaiderDrops() : array

Extra drops of a captain: its ominous banner, and an ominous bottle of a random level (Bad Omen I-V) when it was killed by a player outside a raid (1.21+; captains no longer give Bad Omen directly).

isCelebrating() ​

php
public function isCelebrating() : bool

isPatrolLeader() ​

php
public function isPatrolLeader() : bool

isPatrolling() ​

php
public function isPatrolling() : bool

joinRaid() ​

php
public function joinRaid(int $raidId, int $wave, \pocketmine\math\Vector3 $center) : void

leaveRaid() ​

php
public function leaveRaid() : void

loadRaiderData() protected ​

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

onDeath() protected ​

php
protected function onDeath() : void

registerRaiderGoals() protected ​

php
protected function registerRaiderGoals(int $movePriority, int $targetPriority, bool $victimsOutsideRaids) : void

Adds the patrol and raid goals: walking with the patrol or to the raided village at $movePriority, and attacking the raid victims (Raider::isRaidVictim()) within 16 blocks, always (vanilla illagers and ravagers) or only while raiding (witches).

saveRaiderData() protected ​

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

setCelebrating() ​

php
public function setCelebrating(bool $celebrating) : void

setPatrolLeader() ​

php
public function setPatrolLeader(bool $leader) : void

setPatrolTarget() ​

php
public function setPatrolTarget(?\pocketmine\math\Vector3 $target) : void

setPatrolling() ​

php
public function setPatrolling(bool $patrolling) : void

syncRaiderData() protected ​

php
protected function syncRaiderData(\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.