Class StatAwardEvent

All Implemented Interfaces:
net.neoforged.bus.api.ICancellableEvent

public class StatAwardEvent extends PlayerEvent implements net.neoforged.bus.api.ICancellableEvent
Fired when a Player is awarded a Stat. This event is fired in Player.awardStat(Stat, int)

This event is cancelable.

This event does not have a result.

This event is fired on the

invalid reference
NeoForge#EVENT_BUS
.
  • Field Details

    • stat

      private Stat<?> stat
    • value

      private int value
  • Constructor Details

    • StatAwardEvent

      @Internal public StatAwardEvent(Player player, Stat<?> stat, int value)
  • Method Details

    • getStat

      public Stat<?> getStat()
      Returns the Stat being awarded.
      Returns:
      the Stat being awarded
    • setStat

      public void setStat(Stat<?> stat)
      Replaces the Stat to be awarded
    • getValue

      public int getValue()
      Returns the current value to be awarded to the Stat.
      Returns:
      the current value to be awarded to the Stat
    • setValue

      public void setValue(int value)
      Replaces the value to be awarded.