Gossips 5.46.0
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 = 24000Ticks between two decays (20 minutes).
MAX_TARGETS
php
public const MAX_TARGETS = 64Players 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) : voiddecay()
php
public function decay() : voidLowers every gossip by its decay (called every Gossips::DECAY_INTERVAL ticks).
fromNbt()
php
public static function fromNbt(?\pocketmine\nbt\tag\ListTag $list) : selfget()
php
public function get(string $target, \pocketmine\entity\npc\GossipType $type) : intgetReputation()
php
public function getReputation(string $target) : intSum of the gossip values about the player times their weights (negative when the player hurt villagers).
isEmpty()
php
public function isEmpty() : boolshareWith()
php
public function shareWith(\pocketmine\entity\npc\Gossips $other) : voidTells 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