Package net.minecraftforge.event
Class VanillaGameEvent
java.lang.Object
net.minecraftforge.eventbus.api.Event
net.minecraftforge.event.VanillaGameEvent
public class VanillaGameEvent
extends net.minecraftforge.eventbus.api.Event
VanillaGameEvent is fired on the server whenever one of Vanilla's
This allows for listening to Vanilla's events in a more structured and global way that is not tied to needing a block entity listener.
This event is fired on the
Cancel this event to prevent Vanilla from posting the
GameEvents
fire. This allows for listening to Vanilla's events in a more structured and global way that is not tied to needing a block entity listener.
This event is fired on the
MinecraftForge.EVENT_BUS
. Cancel this event to prevent Vanilla from posting the
GameEvent
to all nearby GameEventListeners
.-
Nested Class Summary
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
-
Constructor Summary
ConstructorDescriptionVanillaGameEvent
(Level level, Entity cause, GameEvent vanillaEvent, BlockPos position) -
Method Summary
Methods inherited from class net.minecraftforge.eventbus.api.Event
getListenerList, getParentListenerList, getPhase, getResult, hasResult, isCancelable, isCanceled, setCanceled, setPhase, setResult, setup
-
Field Details
-
level
-
cause
-
vanillaEvent
-
position
-
-
Constructor Details
-
VanillaGameEvent
-
-
Method Details
-
getLevel
- Returns:
- The level the Vanilla
GameEvent
occurred.
-
getCause
- Returns:
- The entity that was the source or "cause" of the
GameEvent
.
-
getVanillaEvent
- Returns:
- The Vanilla event.
-
getEventPosition
- Returns:
- The position the event took place at. This may be a block or the block position of the entity targeted.
-