Class ServerPlayerEnvironmentTickEvents

java.lang.Object
com.github.thedeathlycow.thermoo.api.environment.event.ServerPlayerEnvironmentTickEvents

public final class ServerPlayerEnvironmentTickEvents extends Object
Events that are called for a server player each tick to update and apply passive temperature changes based on their environment (as defined in datapacks).

These events will apply to players in spectator mode, but will not apply to dead or removed players.

The order that the events are executed for each player each tick is as follows:

  • ALLOW_TEMPERATURE_UPDATE
  • GET_TEMPERATURE_CHANGE
  • ALLOW_TEMPERATURE_CHANGE
  • Field Details

    • ALLOW_TEMPERATURE_UPDATE

      public static final net.fabricmc.fabric.api.event.Event<ServerPlayerEnvironmentTickEvents.AllowTemperatureChangeUpdate> ALLOW_TEMPERATURE_UPDATE
      Checks if the temperature update should be allowed to proceed at all. Returning any non-default value will force the update to proceed right away. By default, the update will be allowed to proceed.

      At this stage, the context's environment components will be empty.

    • GET_TEMPERATURE_CHANGE

      public static final net.fabricmc.fabric.api.event.Event<ServerPlayerEnvironmentTickEvents.GetTemperatureChange> GET_TEMPERATURE_CHANGE
      Computes the temperature point change for a temperature aware given their environment conditions. All returned values will be added to together and, if allowed, will be applied in one temperature change.

      From this point onwards, the context environment components will be defined, but some values may still be empty.

    • ALLOW_TEMPERATURE_CHANGE

      public static final net.fabricmc.fabric.api.event.Event<ServerPlayerEnvironmentTickEvents.AllowTemperatureChangeApply> ALLOW_TEMPERATURE_CHANGE
      Checks if the final temperature change update calculated by GET_TEMPERATURE_CHANGE should be allowed to be applied to the player. Returning any non-default value will force the update to be applied right away. By default, the update will be allowed to be applied. A temperature change of 0 will not invoke this event, and temperature changes of 0 will never apply.