Class WorldEvent

java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.world.WorldEvent
Direct Known Subclasses:
ChunkEvent, SaplingGrowTreeEvent, SleepFinishedTimeEvent, WorldEvent.CreateSpawnPosition, WorldEvent.Load, WorldEvent.PotentialSpawns, WorldEvent.Save, WorldEvent.Unload

public class WorldEvent extends net.minecraftforge.eventbus.api.Event
WorldEvent is fired when an event involving the world occurs.
If a method utilizes this Event as its parameter, the method will receive every child event of this class.

world contains the World this event is occurring in.

All children of this event are fired on the MinecraftForge#EVENT_BUS.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static class 
    Called by WorldServer when it attempts to create a spawnpoint for a dimension.
    static class 
    WorldEvent.Load is fired when Minecraft loads a world.
    This event is fired when a world is loaded in WorldClient#WorldClient(NetHandlerPlayClient, WorldSettings, int, EnumDifficulty, Profiler), MinecraftServer#loadAllWorlds(String, String, long, WorldType, String), IntegratedServer#loadAllWorlds(String, String, long, WorldType, String) DimensionManager#initDimension(int), and ForgeInternalHandler#onDimensionLoad(Load).
    static class 
    Called by WorldServer to gather a list of all possible entities that can spawn at the specified location.
    static class 
    WorldEvent.Save is fired when Minecraft saves a world.
    This event is fired when a world is saved in WorldServer#saveAllChunks(boolean, IProgressUpdate), ForgeInternalHandler#onDimensionSave(Save).
    static class 
    WorldEvent.Unload is fired when Minecraft unloads a world.
    This event is fired when a world is unloaded in Minecraft#loadWorld(WorldClient, String), MinecraftServer.stopServer(), DimensionManager#unloadWorlds(), ForgeInternalHandler#onDimensionUnload(Unload).

    Nested classes/interfaces inherited from class net.minecraftforge.eventbus.api.Event

    net.minecraftforge.eventbus.api.Event.HasResult, net.minecraftforge.eventbus.api.Event.Result
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private final IWorld
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
     

    Methods inherited from class net.minecraftforge.eventbus.api.Event

    getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup

    Methods inherited from class java.lang.Object

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

    • world

      private final IWorld world
  • Constructor Details

    • WorldEvent

      public WorldEvent(IWorld world)
  • Method Details

    • getWorld

      public IWorld getWorld()