final class Main extends PluginBase implements Listener {
public function onEnable() : void {
$this->getServer()->getPluginManager()->registerEvents($this, $this);
InfoAPI::addMapping(
$this, "myplugin.money",
fn(Player $player) : int => 123,
);
}
public function onChat(PlayerJoinEvent $event) : void {
$event->setJoinMessage(InfoAPI::render(
$this, '{yellow}{player} {white}joined the server in world {aqua}"{player money}".',
["player" => $event->getPlayer()],
));
}
}