Package net.minecraftforge.event
Class ForgeEventFactory
java.lang.Object
net.minecraftforge.event.ForgeEventFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canCreateFluidSource
(IWorldReader world, BlockPos pos, BlockState state, boolean def) static net.minecraftforge.eventbus.api.Event.Result
canEntityDespawn
(MobEntity entity) static net.minecraftforge.eventbus.api.Event.Result
canEntitySpawn
(MobEntity entity, IWorld world, double x, double y, double z, AbstractSpawner spawner, SpawnReason spawnReason) static boolean
canEntitySpawnSpawner
(MobEntity entity, World world, float x, float y, float z, AbstractSpawner spawner) static boolean
canEntityUpdate
(Entity entity) static boolean
canLivingConvert
(LivingEntity entity, EntityType<? extends LivingEntity> outcome, Consumer<Integer> timer) static boolean
canMountEntity
(Entity entityMounting, Entity entityBeingMounted, boolean isMounting) static boolean
doPlayerHarvestCheck
(PlayerEntity player, BlockState state, boolean success) static boolean
doSpecialSpawn
(MobEntity entity, World world, float x, float y, float z, AbstractSpawner spawner, SpawnReason spawnReason) static void
fireChunkWatch
(boolean wasLoaded, boolean load, ServerPlayerEntity entity, ChunkPos chunkpos, ServerWorld world) static void
fireChunkWatch
(boolean watch, ServerPlayerEntity entity, ChunkPos chunkpos, ServerWorld world) static BlockState
fireFluidPlaceBlockEvent
(IWorld world, BlockPos pos, BlockPos liquidPos, BlockState state) static void
firePlayerLoadingEvent
(PlayerEntity player, File playerDirectory, String uuidString) static void
firePlayerLoadingEvent
(PlayerEntity player, PlayerData playerFileData, String uuidString) static void
firePlayerSavingEvent
(PlayerEntity player, File playerDirectory, String uuidString) static boolean
fireSleepingLocationCheck
(LivingEntity player, BlockPos sleepingLocation) static boolean
fireSleepingTimeCheck
(PlayerEntity player, Optional<BlockPos> sleepingLocation) static ZombieEvent.SummonAidEvent
fireZombieSummonAid
(ZombieEntity zombie, World world, int x, int y, int z, LivingEntity attacker, double summonChance) static <T extends ICapabilityProvider>
CapabilityDispatchergatherCapabilities
(Class<? extends T> type, T provider) static <T extends ICapabilityProvider>
CapabilityDispatchergatherCapabilities
(Class<? extends T> type, T provider, ICapabilityProvider parent) private static CapabilityDispatcher
gatherCapabilities
(AttachCapabilitiesEvent<?> event, ICapabilityProvider parent) static float
getBreakSpeed
(PlayerEntity player, BlockState state, float original, BlockPos pos) static EntityEvent.Size
getEntitySizeForge
(Entity entity, Pose pose, EntitySize size, float eyeHeight) static EntityEvent.Size
getEntitySizeForge
(Entity entity, Pose pose, EntitySize oldSize, EntitySize newSize, float newEyeHeight) static int
getExperienceDrop
(LivingEntity entity, PlayerEntity attackingPlayer, int originalExperience) static int
getItemBurnTime
(ItemStack itemStack, int burnTime) Deprecated.static int
getItemBurnTime
(ItemStack itemStack, int burnTime, IRecipeType<?> recipeType) static int
getMaxSpawnPackSize
(MobEntity entity) static boolean
getMobGriefingEvent
(World world, Entity entity) static ITextComponent
getPlayerDisplayName
(PlayerEntity player, ITextComponent username) static ITextComponent
static List<MobSpawnInfo.Spawners>
getPotentialSpawns
(IWorld world, EntityClassification type, BlockPos pos, List<MobSpawnInfo.Spawners> oldList) static LootTable
loadLootTable
(ResourceLocation name, LootTable table, LootTableManager lootTableManager) static boolean
onAnimalTame
(AnimalEntity animal, PlayerEntity tamer) static int
onApplyBonemeal
(PlayerEntity player, World world, BlockPos pos, BlockState state, ItemStack stack) static int
onArrowLoose
(ItemStack stack, World world, PlayerEntity player, int charge, boolean hasAmmo) static ActionResult<ItemStack>
onArrowNock
(ItemStack item, World world, PlayerEntity player, Hand hand, boolean hasAmmo) static boolean
onBlockPlace
(Entity entity, BlockSnapshot blockSnapshot, Direction direction) static ActionResult<ItemStack>
onBucketUse
(PlayerEntity player, World world, ItemStack stack, RayTraceResult target) onChorusFruitTeleport
(LivingEntity entity, double targetX, double targetY, double targetZ) static ITextComponent
onClientChat
(ChatType type, ITextComponent message, UUID senderUUID) static String
onClientSendMessage
(String message) static void
onCommandRegister
(com.mojang.brigadier.CommandDispatcher<CommandSource> dispatcher, Commands.EnvironmentType environment) static boolean
onCreateWorldSpawn
(World world, IServerWorldInfo settings) static int
onEnchantmentLevelSet
(World world, BlockPos pos, int enchantRow, int power, ItemStack itemStack, int level) onEnderPearlLand
(ServerPlayerEntity entity, double targetX, double targetY, double targetZ, EnderPearlEntity pearlEntity, float attackDamage) onEnderTeleport
(LivingEntity entity, double targetX, double targetY, double targetZ) static boolean
onEntityDestroyBlock
(LivingEntity entity, BlockPos pos, BlockState state) static boolean
onEntityStruckByLightning
(Entity entity, LightningBoltEntity bolt) onEntityTeleportCommand
(Entity entity, double targetX, double targetY, double targetZ) onEntityTeleportSpreadPlayersCommand
(Entity entity, double targetX, double targetY, double targetZ) static void
onExplosionDetonate
(World world, Explosion explosion, List<Entity> list, double diameter) static boolean
onExplosionStart
(World world, Explosion explosion) static int
onHoeUse
(ItemUseContext context) Deprecated.static int
onItemExpire
(ItemEntity entity, ItemStack item) static int
onItemPickup
(ItemEntity entityItem, PlayerEntity player) static ItemTooltipEvent
onItemTooltip
(ItemStack itemStack, PlayerEntity entityPlayer, List<ITextComponent> list, ITooltipFlag flags) static ItemStack
onItemUseFinish
(LivingEntity entity, ItemStack item, int duration, ItemStack result) static int
onItemUseStart
(LivingEntity entity, ItemStack item, int duration) static int
onItemUseTick
(LivingEntity entity, ItemStack item, int duration) static void
onLivingConvert
(LivingEntity entity, LivingEntity outcome) static float
onLivingHeal
(LivingEntity entity, float amount) static boolean
onMultiBlockPlace
(Entity entity, List<BlockSnapshot> blockSnapshots, Direction direction) onNeighborNotify
(World world, BlockPos pos, BlockState state, EnumSet<Direction> notifiedSides, boolean forceRedstoneUpdate) private static float
onOldEnderTeleport
(LivingEntity entity, float attackDamage, EntityTeleportEvent event) static boolean
onPistonMovePost
(World world, BlockPos pos, Direction direction, boolean extending) static boolean
onPistonMovePre
(World world, BlockPos pos, Direction direction, boolean extending) static void
onPlayerBrewedPotion
(PlayerEntity player, ItemStack stack) static void
onPlayerClone
(PlayerEntity player, PlayerEntity oldPlayer, boolean wasDeath) static void
onPlayerDestroyItem
(PlayerEntity player, ItemStack stack, Hand hand) static void
onPlayerFall
(PlayerEntity player, float distance, float multiplier) static PlayerEntity.SleepResult
onPlayerSleepInBed
(PlayerEntity player, Optional<BlockPos> pos) static boolean
onPlayerSpawnSet
(PlayerEntity player, RegistryKey<World> world, BlockPos pos, boolean forced) static void
onPlayerWakeup
(PlayerEntity player, boolean wakeImmediately, boolean updateWorldFlag) static PlaySoundAtEntityEvent
onPlaySoundAtEntity
(Entity entity, SoundEvent name, SoundCategory category, float volume, float pitch) static boolean
onPotionAttemptBrew
(NonNullList<ItemStack> stacks) static void
onPotionBrewed
(NonNullList<ItemStack> brewingItemStacks) static boolean
onProjectileImpact
(Entity entity, RayTraceResult ray) static boolean
onProjectileImpact
(AbstractArrowEntity arrow, RayTraceResult ray) static boolean
onProjectileImpact
(DamagingProjectileEntity fireball, RayTraceResult ray) static boolean
onProjectileImpact
(FireworkRocketEntity fireworkRocket, RayTraceResult ray) static boolean
onProjectileImpact
(FishingBobberEntity fishingBobber, RayTraceResult ray) static boolean
onProjectileImpact
(ThrowableEntity throwable, RayTraceResult ray) static List<IFutureReloadListener>
onResourceReload
(DataPackRegistries dataPackRegistries) static long
onSleepFinished
(ServerWorld world, long newTime, long minTime) static void
onStartEntityTracking
(Entity entity, PlayerEntity player) static void
onStopEntityTracking
(Entity entity, PlayerEntity player) static BlockState
onToolUse
(BlockState originalState, World world, BlockPos pos, PlayerEntity player, ItemStack stack, ToolType toolType) static Optional<PortalSize>
onTrySpawnPortal
(IWorld world, BlockPos pos, Optional<PortalSize> size) static boolean
onUseItemStop
(LivingEntity entity, ItemStack item, int duration) static boolean
renderBlockOverlay
(PlayerEntity player, MatrixStack mat, RenderBlockOverlayEvent.OverlayType type, BlockState block, BlockPos pos) static boolean
renderFireOverlay
(PlayerEntity player, MatrixStack mat) static boolean
renderWaterOverlay
(PlayerEntity player, MatrixStack mat) static boolean
saplingGrowTree
(IWorld world, Random rand, BlockPos pos)
-
Constructor Details
-
ForgeEventFactory
public ForgeEventFactory()
-
-
Method Details
-
onMultiBlockPlace
public static boolean onMultiBlockPlace(@Nullable Entity entity, List<BlockSnapshot> blockSnapshots, Direction direction) -
onBlockPlace
public static boolean onBlockPlace(@Nullable Entity entity, @Nonnull BlockSnapshot blockSnapshot, @Nonnull Direction direction) -
onNeighborNotify
public static BlockEvent.NeighborNotifyEvent onNeighborNotify(World world, BlockPos pos, BlockState state, EnumSet<Direction> notifiedSides, boolean forceRedstoneUpdate) -
doPlayerHarvestCheck
-
getBreakSpeed
public static float getBreakSpeed(PlayerEntity player, BlockState state, float original, BlockPos pos) -
onPlayerDestroyItem
public static void onPlayerDestroyItem(PlayerEntity player, @Nonnull ItemStack stack, @Nullable Hand hand) -
canEntitySpawn
public static net.minecraftforge.eventbus.api.Event.Result canEntitySpawn(MobEntity entity, IWorld world, double x, double y, double z, AbstractSpawner spawner, SpawnReason spawnReason) -
canEntitySpawnSpawner
public static boolean canEntitySpawnSpawner(MobEntity entity, World world, float x, float y, float z, AbstractSpawner spawner) -
doSpecialSpawn
public static boolean doSpecialSpawn(MobEntity entity, World world, float x, float y, float z, AbstractSpawner spawner, SpawnReason spawnReason) -
canEntityDespawn
-
getItemBurnTime
Deprecated. -
getItemBurnTime
public static int getItemBurnTime(@Nonnull ItemStack itemStack, int burnTime, @Nullable IRecipeType<?> recipeType) -
getExperienceDrop
public static int getExperienceDrop(LivingEntity entity, PlayerEntity attackingPlayer, int originalExperience) -
getPotentialSpawns
@Nullable public static List<MobSpawnInfo.Spawners> getPotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, List<MobSpawnInfo.Spawners> oldList) -
getMaxSpawnPackSize
-
getPlayerDisplayName
-
getPlayerTabListDisplayName
-
fireFluidPlaceBlockEvent
public static BlockState fireFluidPlaceBlockEvent(IWorld world, BlockPos pos, BlockPos liquidPos, BlockState state) -
onItemTooltip
public static ItemTooltipEvent onItemTooltip(ItemStack itemStack, @Nullable PlayerEntity entityPlayer, List<ITextComponent> list, ITooltipFlag flags) -
fireZombieSummonAid
public static ZombieEvent.SummonAidEvent fireZombieSummonAid(ZombieEntity zombie, World world, int x, int y, int z, LivingEntity attacker, double summonChance) -
onEntityStruckByLightning
-
onItemUseStart
-
onItemUseTick
-
onUseItemStop
-
onItemUseFinish
public static ItemStack onItemUseFinish(LivingEntity entity, ItemStack item, int duration, ItemStack result) -
onStartEntityTracking
-
onStopEntityTracking
-
firePlayerLoadingEvent
public static void firePlayerLoadingEvent(PlayerEntity player, File playerDirectory, String uuidString) -
firePlayerSavingEvent
public static void firePlayerSavingEvent(PlayerEntity player, File playerDirectory, String uuidString) -
firePlayerLoadingEvent
public static void firePlayerLoadingEvent(PlayerEntity player, PlayerData playerFileData, String uuidString) -
onClientChat
@Nullable public static ITextComponent onClientChat(ChatType type, ITextComponent message, @Nullable UUID senderUUID) -
onClientSendMessage
-
onHoeUse
Deprecated. -
onToolUse
@Nullable public static BlockState onToolUse(BlockState originalState, World world, BlockPos pos, PlayerEntity player, ItemStack stack, ToolType toolType) -
onApplyBonemeal
public static int onApplyBonemeal(@Nonnull PlayerEntity player, @Nonnull World world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull ItemStack stack) -
onBucketUse
@Nullable public static ActionResult<ItemStack> onBucketUse(@Nonnull PlayerEntity player, @Nonnull World world, @Nonnull ItemStack stack, @Nullable RayTraceResult target) -
canEntityUpdate
-
onPlaySoundAtEntity
public static PlaySoundAtEntityEvent onPlaySoundAtEntity(Entity entity, SoundEvent name, SoundCategory category, float volume, float pitch) -
onItemExpire
-
onItemPickup
-
canMountEntity
-
onAnimalTame
-
onPlayerSleepInBed
public static PlayerEntity.SleepResult onPlayerSleepInBed(PlayerEntity player, Optional<BlockPos> pos) -
onPlayerWakeup
public static void onPlayerWakeup(PlayerEntity player, boolean wakeImmediately, boolean updateWorldFlag) -
onPlayerFall
-
onPlayerSpawnSet
public static boolean onPlayerSpawnSet(PlayerEntity player, RegistryKey<World> world, BlockPos pos, boolean forced) -
onPlayerClone
-
onExplosionStart
-
onExplosionDetonate
-
onCreateWorldSpawn
-
onLivingHeal
-
onPotionAttemptBrew
-
onPotionBrewed
-
onPlayerBrewedPotion
-
renderFireOverlay
-
renderWaterOverlay
-
renderBlockOverlay
public static boolean renderBlockOverlay(PlayerEntity player, MatrixStack mat, RenderBlockOverlayEvent.OverlayType type, BlockState block, BlockPos pos) -
gatherCapabilities
@Nullable public static <T extends ICapabilityProvider> CapabilityDispatcher gatherCapabilities(Class<? extends T> type, T provider) -
gatherCapabilities
@Nullable public static <T extends ICapabilityProvider> CapabilityDispatcher gatherCapabilities(Class<? extends T> type, T provider, @Nullable ICapabilityProvider parent) -
gatherCapabilities
@Nullable private static CapabilityDispatcher gatherCapabilities(AttachCapabilitiesEvent<?> event, @Nullable ICapabilityProvider parent) -
fireSleepingLocationCheck
-
fireSleepingTimeCheck
public static boolean fireSleepingTimeCheck(PlayerEntity player, Optional<BlockPos> sleepingLocation) -
onArrowNock
public static ActionResult<ItemStack> onArrowNock(ItemStack item, World world, PlayerEntity player, Hand hand, boolean hasAmmo) -
onArrowLoose
public static int onArrowLoose(ItemStack stack, World world, PlayerEntity player, int charge, boolean hasAmmo) -
onProjectileImpact
-
onProjectileImpact
-
onProjectileImpact
-
onProjectileImpact
-
onProjectileImpact
-
onProjectileImpact
-
loadLootTable
public static LootTable loadLootTable(ResourceLocation name, LootTable table, LootTableManager lootTableManager) -
canCreateFluidSource
public static boolean canCreateFluidSource(IWorldReader world, BlockPos pos, BlockState state, boolean def) -
onTrySpawnPortal
public static Optional<PortalSize> onTrySpawnPortal(IWorld world, BlockPos pos, Optional<PortalSize> size) -
onEnchantmentLevelSet
-
onEntityDestroyBlock
-
getMobGriefingEvent
-
saplingGrowTree
-
fireChunkWatch
public static void fireChunkWatch(boolean watch, ServerPlayerEntity entity, ChunkPos chunkpos, ServerWorld world) -
fireChunkWatch
public static void fireChunkWatch(boolean wasLoaded, boolean load, ServerPlayerEntity entity, ChunkPos chunkpos, ServerWorld world) -
onPistonMovePre
-
onPistonMovePost
-
onSleepFinished
-
onResourceReload
-
onCommandRegister
public static void onCommandRegister(com.mojang.brigadier.CommandDispatcher<CommandSource> dispatcher, Commands.EnvironmentType environment) -
getEntitySizeForge
public static EntityEvent.Size getEntitySizeForge(Entity entity, Pose pose, EntitySize size, float eyeHeight) -
getEntitySizeForge
public static EntityEvent.Size getEntitySizeForge(Entity entity, Pose pose, EntitySize oldSize, EntitySize newSize, float newEyeHeight) -
canLivingConvert
public static boolean canLivingConvert(LivingEntity entity, EntityType<? extends LivingEntity> outcome, Consumer<Integer> timer) -
onLivingConvert
-
onEntityTeleportCommand
public static EntityTeleportEvent.TeleportCommand onEntityTeleportCommand(Entity entity, double targetX, double targetY, double targetZ) -
onEntityTeleportSpreadPlayersCommand
public static EntityTeleportEvent.SpreadPlayersCommand onEntityTeleportSpreadPlayersCommand(Entity entity, double targetX, double targetY, double targetZ) -
onEnderTeleport
public static EntityTeleportEvent.EnderEntity onEnderTeleport(LivingEntity entity, double targetX, double targetY, double targetZ) -
onEnderPearlLand
public static EntityTeleportEvent.EnderPearl onEnderPearlLand(ServerPlayerEntity entity, double targetX, double targetY, double targetZ, EnderPearlEntity pearlEntity, float attackDamage) -
onOldEnderTeleport
private static float onOldEnderTeleport(LivingEntity entity, float attackDamage, EntityTeleportEvent event) -
onChorusFruitTeleport
public static EntityTeleportEvent.ChorusFruit onChorusFruitTeleport(LivingEntity entity, double targetX, double targetY, double targetZ)
-