Skip to content

Gossips 5.46.0 ​

final class · pocketmine\entity\npc\Gossips · source

What a villager has heard about players (per player UUID): the gossip values of each GossipType. The reputation of a player is the sum of value x weight. Gossip decays every 20 minutes and is passed on (minus its share cost) when villagers meet at the bell.

Constants ​

DECAY_INTERVAL ​

php
public const DECAY_INTERVAL = 24000

Ticks between two decays (20 minutes).

MAX_TARGETS ​

php
public const MAX_TARGETS = 64

Players remembered at most; the ones with the least gossip are forgotten first.

Methods ​

add() ​

php
public function add(string $target, \pocketmine\entity\npc\GossipType $type, int $amount) : void

decay() ​

php
public function decay() : void

Lowers every gossip by its decay (called every Gossips::DECAY_INTERVAL ticks).

fromNbt() ​

php
public static function fromNbt(?\pocketmine\nbt\tag\ListTag $list) : self

get() ​

php
public function get(string $target, \pocketmine\entity\npc\GossipType $type) : int

getReputation() ​

php
public function getReputation(string $target) : int

Sum of the gossip values about the player times their weights (negative when the player hurt villagers).

isEmpty() ​

php
public function isEmpty() : bool

shareWith() ​

php
public function shareWith(\pocketmine\entity\npc\Gossips $other) : void

Tells the other villager what this one knows: it keeps the higher of its own value and this one minus the share cost.

toNbt() ​

php
public function toNbt() : \pocketmine\nbt\tag\ListTag

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