Class LevelTickEvent

java.lang.Object
net.neoforged.bus.api.Event
net.neoforged.neoforge.event.tick.LevelTickEvent
Direct Known Subclasses:
LevelTickEvent.Post, LevelTickEvent.Pre

public abstract class LevelTickEvent extends net.neoforged.bus.api.Event
Base class of the two level tick events.
See Also:
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    LevelTickEvent.Post is fired once per game tick, per level, after the level performs work for the current tick.
    static class 
    LevelTickEvent.Pre is fired once per game tick, per level, before the level performs work for the current tick.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final BooleanSupplier
     
    private final net.minecraft.world.level.Level
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    LevelTickEvent(BooleanSupplier hasTime, net.minecraft.world.level.Level level)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.world.level.Level
    Returns the level being ticked.
    boolean
    On the server, returns true if the server has enough time to perform any additional tasks (usually IO related) during the current tick.

    Methods inherited from class java.lang.Object

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

    • hasTime

      private final BooleanSupplier hasTime
    • level

      private final net.minecraft.world.level.Level level
  • Constructor Details

    • LevelTickEvent

      protected LevelTickEvent(BooleanSupplier hasTime, net.minecraft.world.level.Level level)
  • Method Details

    • hasTime

      public boolean hasTime()
      On the server, returns true if the server has enough time to perform any additional tasks (usually IO related) during the current tick. On the client, always returns true.
    • getLevel

      public net.minecraft.world.level.Level getLevel()
      Returns the level being ticked.
      Returns:
      the level being ticked