Class Board

java.lang.Object
me.hsgamer.hscore.minestom.board.Board

public class Board extends Object
A simple scoreboard for Minestom. Call hook(EventNode) when the server is starting up to make sure the feature work properly.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Board(Function<net.minestom.server.entity.Player,net.kyori.adventure.text.Component> title, Function<net.minestom.server.entity.Player,List<net.kyori.adventure.text.Component>> lines)
    Create a new board
  • Method Summary

    Modifier and Type
    Method
    Description
    static void
    hook(net.minestom.server.event.EventNode<net.minestom.server.event.Event> node)
    Hook the board event to the event node.
    static void
    hook(net.minestom.server.event.EventNode<net.minestom.server.event.Event> node, boolean initOnJoin, boolean removeOnQuit)
    Hook the board event to the event node.
    static void
    init(net.minestom.server.entity.Player player)
    Initialize the board for the player
    static void
    remove(net.minestom.server.entity.Player player)
    Remove the board for the player
    boolean
    update(net.minestom.server.entity.Player player)
    Update the board for the player

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Board

      public Board(Function<net.minestom.server.entity.Player,net.kyori.adventure.text.Component> title, Function<net.minestom.server.entity.Player,List<net.kyori.adventure.text.Component>> lines)
      Create a new board
      Parameters:
      title - the title supplier
      lines - the lines supplier
  • Method Details

    • hook

      public static void hook(net.minestom.server.event.EventNode<net.minestom.server.event.Event> node, boolean initOnJoin, boolean removeOnQuit)
      Hook the board event to the event node. Call the method when the server is starting up to hook the event and make sure the function work properly.
      Parameters:
      node - the event node
      initOnJoin - true to initialize the board when the player joins the server
      removeOnQuit - true to remove the board when the player quits the server
    • hook

      public static void hook(net.minestom.server.event.EventNode<net.minestom.server.event.Event> node)
      Hook the board event to the event node. Call the method when the server is starting up to hook the event and make sure the function work properly.
      Parameters:
      node - the event node
    • init

      public static void init(net.minestom.server.entity.Player player)
      Initialize the board for the player
      Parameters:
      player - the player
    • remove

      public static void remove(net.minestom.server.entity.Player player)
      Remove the board for the player
      Parameters:
      player - the player
    • update

      public boolean update(net.minestom.server.entity.Player player)
      Update the board for the player
      Parameters:
      player - the player
      Returns:
      true if the board was updated, false if the board is not initialized