Skip to content

RaidManager 5.46.0 ​

final class · pocketmine\world\raid\RaidManager · source

The raids of a world: turns Bad Omen into Raid Omen when a player enters a village, starts a raid when Raid Omen runs out, ticks the raids (Raid) and keeps them in RaidStore so that they survive restarts.

Constants ​

MIN_RAID_DISTANCE ​

php
public const MIN_RAID_DISTANCE = 96.0

Two raids can't be closer than this (blocks between centres).

OMEN_CHECK_INTERVAL ​

php
public const OMEN_CHECK_INTERVAL = 20

Ticks between two checks of whether players with Bad Omen are in a village.

Methods ​

__construct() ​

php
public function __construct(\pocketmine\world\World $world, ?\pocketmine\world\raid\RaidStore $store = null, ?bool $enabled = null)

close() ​

php
public function close() : void

Called when the world is unloaded: saves the raids and hides their bars.

getRaid() ​

php
public function getRaid(int $id) : ?\pocketmine\world\raid\Raid

getRaidAt() ​

php
public function getRaidAt(\pocketmine\math\Vector3 $pos, float $range = self::MIN_RAID_DISTANCE) : ?\pocketmine\world\raid\Raid

Returns the ongoing raid whose village is around the position, if any.

getRaids() ​

php
public function getRaids() : array

isEnabled() ​

php
public function isEnabled() : bool

onRaidOmenExpired() ​

php
public function onRaidOmenExpired(\pocketmine\player\Player $player, int $amplifier) : void

Called by RaidOmenEffect when a player's Raid Omen runs out.

onRaiderDeath() ​

php
public function onRaiderDeath(\pocketmine\entity\monster\Raider $raider, ?\pocketmine\player\Player $killer) : void

Called when a raider taking part in a raid of this world dies.

save() ​

php
public function save() : void

startRaid() ​

php
public function startRaid(\pocketmine\world\raid\Village $village, int $omenLevel = 1) : \pocketmine\world\raid\Raid

Starts a raid on the village (as if a Raid Omen of the given level ran out there).

stopAll() ​

php
public function stopAll() : void

Ends every raid of the world at once (bars hidden, raiders back to normal).

tick() ​

php
public function tick(int $currentTick) : void

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