Package net.minecraftforge.event
Class ForgeEventFactory
- java.lang.Object
-
- net.minecraftforge.event.ForgeEventFactory
-
public class ForgeEventFactory extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description ForgeEventFactory()
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static 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, java.util.function.Consumer<java.lang.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, java.io.File playerDirectory, java.lang.String uuidString)
static void
firePlayerLoadingEvent(PlayerEntity player, PlayerData playerFileData, java.lang.String uuidString)
static void
firePlayerSavingEvent(PlayerEntity player, java.io.File playerDirectory, java.lang.String uuidString)
static boolean
fireSleepingLocationCheck(LivingEntity player, BlockPos sleepingLocation)
static boolean
fireSleepingTimeCheck(PlayerEntity player, java.util.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(java.lang.Class<? extends T> type, T provider)
static <T extends ICapabilityProvider>
CapabilityDispatchergatherCapabilities(java.lang.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
getPlayerTabListDisplayName(PlayerEntity player)
static java.util.List<MobSpawnInfo.Spawners>
getPotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, java.util.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)
static EntityTeleportEvent.ChorusFruit
onChorusFruitTeleport(LivingEntity entity, double targetX, double targetY, double targetZ)
static ITextComponent
onClientChat(ChatType type, ITextComponent message, java.util.UUID senderUUID)
static java.lang.String
onClientSendMessage(java.lang.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)
static EntityTeleportEvent.EnderPearl
onEnderPearlLand(ServerPlayerEntity entity, double targetX, double targetY, double targetZ, EnderPearlEntity pearlEntity, float attackDamage)
static EntityTeleportEvent.EnderEntity
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)
static EntityTeleportEvent.TeleportCommand
onEntityTeleportCommand(Entity entity, double targetX, double targetY, double targetZ)
static EntityTeleportEvent.SpreadPlayersCommand
onEntityTeleportSpreadPlayersCommand(Entity entity, double targetX, double targetY, double targetZ)
static void
onExplosionDetonate(World world, Explosion explosion, java.util.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, java.util.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, java.util.List<BlockSnapshot> blockSnapshots, Direction direction)
static BlockEvent.NeighborNotifyEvent
onNeighborNotify(World world, BlockPos pos, BlockState state, java.util.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, java.util.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 java.util.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 java.util.Optional<PortalSize>
onTrySpawnPortal(IWorld world, BlockPos pos, java.util.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, java.util.Random rand, BlockPos pos)
-
-
-
Method Detail
-
onMultiBlockPlace
public static boolean onMultiBlockPlace(@Nullable Entity entity, java.util.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, java.util.EnumSet<Direction> notifiedSides, boolean forceRedstoneUpdate)
-
doPlayerHarvestCheck
public static boolean doPlayerHarvestCheck(PlayerEntity player, BlockState state, boolean success)
-
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
public static net.minecraftforge.eventbus.api.Event.Result canEntityDespawn(MobEntity entity)
-
getItemBurnTime
@Deprecated public static int getItemBurnTime(@Nonnull ItemStack itemStack, int burnTime)
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 java.util.List<MobSpawnInfo.Spawners> getPotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, java.util.List<MobSpawnInfo.Spawners> oldList)
-
getMaxSpawnPackSize
public static int getMaxSpawnPackSize(MobEntity entity)
-
getPlayerDisplayName
public static ITextComponent getPlayerDisplayName(PlayerEntity player, ITextComponent username)
-
getPlayerTabListDisplayName
public static ITextComponent getPlayerTabListDisplayName(PlayerEntity player)
-
fireFluidPlaceBlockEvent
public static BlockState fireFluidPlaceBlockEvent(IWorld world, BlockPos pos, BlockPos liquidPos, BlockState state)
-
onItemTooltip
public static ItemTooltipEvent onItemTooltip(ItemStack itemStack, @Nullable PlayerEntity entityPlayer, java.util.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
public static boolean onEntityStruckByLightning(Entity entity, LightningBoltEntity bolt)
-
onItemUseStart
public static int onItemUseStart(LivingEntity entity, ItemStack item, int duration)
-
onItemUseTick
public static int onItemUseTick(LivingEntity entity, ItemStack item, int duration)
-
onUseItemStop
public static boolean onUseItemStop(LivingEntity entity, ItemStack item, int duration)
-
onItemUseFinish
public static ItemStack onItemUseFinish(LivingEntity entity, ItemStack item, int duration, ItemStack result)
-
onStartEntityTracking
public static void onStartEntityTracking(Entity entity, PlayerEntity player)
-
onStopEntityTracking
public static void onStopEntityTracking(Entity entity, PlayerEntity player)
-
firePlayerLoadingEvent
public static void firePlayerLoadingEvent(PlayerEntity player, java.io.File playerDirectory, java.lang.String uuidString)
-
firePlayerSavingEvent
public static void firePlayerSavingEvent(PlayerEntity player, java.io.File playerDirectory, java.lang.String uuidString)
-
firePlayerLoadingEvent
public static void firePlayerLoadingEvent(PlayerEntity player, PlayerData playerFileData, java.lang.String uuidString)
-
onClientChat
@Nullable public static ITextComponent onClientChat(ChatType type, ITextComponent message, @Nullable java.util.UUID senderUUID)
-
onClientSendMessage
@Nonnull public static java.lang.String onClientSendMessage(java.lang.String message)
-
onHoeUse
@Deprecated public static int onHoeUse(ItemUseContext context)
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
public static boolean canEntityUpdate(Entity entity)
-
onPlaySoundAtEntity
public static PlaySoundAtEntityEvent onPlaySoundAtEntity(Entity entity, SoundEvent name, SoundCategory category, float volume, float pitch)
-
onItemExpire
public static int onItemExpire(ItemEntity entity, @Nonnull ItemStack item)
-
onItemPickup
public static int onItemPickup(ItemEntity entityItem, PlayerEntity player)
-
canMountEntity
public static boolean canMountEntity(Entity entityMounting, Entity entityBeingMounted, boolean isMounting)
-
onAnimalTame
public static boolean onAnimalTame(AnimalEntity animal, PlayerEntity tamer)
-
onPlayerSleepInBed
public static PlayerEntity.SleepResult onPlayerSleepInBed(PlayerEntity player, java.util.Optional<BlockPos> pos)
-
onPlayerWakeup
public static void onPlayerWakeup(PlayerEntity player, boolean wakeImmediately, boolean updateWorldFlag)
-
onPlayerFall
public static void onPlayerFall(PlayerEntity player, float distance, float multiplier)
-
onPlayerSpawnSet
public static boolean onPlayerSpawnSet(PlayerEntity player, RegistryKey<World> world, BlockPos pos, boolean forced)
-
onPlayerClone
public static void onPlayerClone(PlayerEntity player, PlayerEntity oldPlayer, boolean wasDeath)
-
onExplosionDetonate
public static void onExplosionDetonate(World world, Explosion explosion, java.util.List<Entity> list, double diameter)
-
onCreateWorldSpawn
public static boolean onCreateWorldSpawn(World world, IServerWorldInfo settings)
-
onLivingHeal
public static float onLivingHeal(LivingEntity entity, float amount)
-
onPotionAttemptBrew
public static boolean onPotionAttemptBrew(NonNullList<ItemStack> stacks)
-
onPotionBrewed
public static void onPotionBrewed(NonNullList<ItemStack> brewingItemStacks)
-
onPlayerBrewedPotion
public static void onPlayerBrewedPotion(PlayerEntity player, ItemStack stack)
-
renderFireOverlay
public static boolean renderFireOverlay(PlayerEntity player, MatrixStack mat)
-
renderWaterOverlay
public static boolean renderWaterOverlay(PlayerEntity player, MatrixStack mat)
-
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(java.lang.Class<? extends T> type, T provider)
-
gatherCapabilities
@Nullable public static <T extends ICapabilityProvider> CapabilityDispatcher gatherCapabilities(java.lang.Class<? extends T> type, T provider, @Nullable ICapabilityProvider parent)
-
gatherCapabilities
@Nullable private static CapabilityDispatcher gatherCapabilities(AttachCapabilitiesEvent<?> event, @Nullable ICapabilityProvider parent)
-
fireSleepingLocationCheck
public static boolean fireSleepingLocationCheck(LivingEntity player, BlockPos sleepingLocation)
-
fireSleepingTimeCheck
public static boolean fireSleepingTimeCheck(PlayerEntity player, java.util.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
public static boolean onProjectileImpact(Entity entity, RayTraceResult ray)
-
onProjectileImpact
public static boolean onProjectileImpact(AbstractArrowEntity arrow, RayTraceResult ray)
-
onProjectileImpact
public static boolean onProjectileImpact(DamagingProjectileEntity fireball, RayTraceResult ray)
-
onProjectileImpact
public static boolean onProjectileImpact(ThrowableEntity throwable, RayTraceResult ray)
-
onProjectileImpact
public static boolean onProjectileImpact(FireworkRocketEntity fireworkRocket, RayTraceResult ray)
-
onProjectileImpact
public static boolean onProjectileImpact(FishingBobberEntity fishingBobber, RayTraceResult ray)
-
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 java.util.Optional<PortalSize> onTrySpawnPortal(IWorld world, BlockPos pos, java.util.Optional<PortalSize> size)
-
onEnchantmentLevelSet
public static int onEnchantmentLevelSet(World world, BlockPos pos, int enchantRow, int power, ItemStack itemStack, int level)
-
onEntityDestroyBlock
public static boolean onEntityDestroyBlock(LivingEntity entity, BlockPos pos, BlockState state)
-
saplingGrowTree
public static boolean saplingGrowTree(IWorld world, java.util.Random rand, BlockPos pos)
-
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
public static boolean onPistonMovePre(World world, BlockPos pos, Direction direction, boolean extending)
-
onPistonMovePost
public static boolean onPistonMovePost(World world, BlockPos pos, Direction direction, boolean extending)
-
onSleepFinished
public static long onSleepFinished(ServerWorld world, long newTime, long minTime)
-
onResourceReload
public static java.util.List<IFutureReloadListener> onResourceReload(DataPackRegistries dataPackRegistries)
-
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, java.util.function.Consumer<java.lang.Integer> timer)
-
onLivingConvert
public static void onLivingConvert(LivingEntity entity, LivingEntity outcome)
-
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)
-
-