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 booleancanCreateFluidSource(IWorldReader world, BlockPos pos, BlockState state, boolean def)static net.minecraftforge.eventbus.api.Event.ResultcanEntityDespawn(MobEntity entity)static net.minecraftforge.eventbus.api.Event.ResultcanEntitySpawn(MobEntity entity, IWorld world, double x, double y, double z, AbstractSpawner spawner, SpawnReason spawnReason)static booleancanEntitySpawnSpawner(MobEntity entity, World world, float x, float y, float z, AbstractSpawner spawner)static booleancanEntityUpdate(Entity entity)static booleancanLivingConvert(LivingEntity entity, EntityType<? extends LivingEntity> outcome, java.util.function.Consumer<java.lang.Integer> timer)static booleancanMountEntity(Entity entityMounting, Entity entityBeingMounted, boolean isMounting)static booleandoPlayerHarvestCheck(PlayerEntity player, BlockState state, boolean success)static booleandoSpecialSpawn(MobEntity entity, World world, float x, float y, float z, AbstractSpawner spawner, SpawnReason spawnReason)static voidfireChunkWatch(boolean wasLoaded, boolean load, ServerPlayerEntity entity, ChunkPos chunkpos, ServerWorld world)static voidfireChunkWatch(boolean watch, ServerPlayerEntity entity, ChunkPos chunkpos, ServerWorld world)static BlockStatefireFluidPlaceBlockEvent(IWorld world, BlockPos pos, BlockPos liquidPos, BlockState state)static voidfirePlayerLoadingEvent(PlayerEntity player, java.io.File playerDirectory, java.lang.String uuidString)static voidfirePlayerLoadingEvent(PlayerEntity player, PlayerData playerFileData, java.lang.String uuidString)static voidfirePlayerSavingEvent(PlayerEntity player, java.io.File playerDirectory, java.lang.String uuidString)static booleanfireSleepingLocationCheck(LivingEntity player, BlockPos sleepingLocation)static booleanfireSleepingTimeCheck(PlayerEntity player, java.util.Optional<BlockPos> sleepingLocation)static ZombieEvent.SummonAidEventfireZombieSummonAid(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 CapabilityDispatchergatherCapabilities(AttachCapabilitiesEvent<?> event, ICapabilityProvider parent)static floatgetBreakSpeed(PlayerEntity player, BlockState state, float original, BlockPos pos)static EntityEvent.SizegetEntitySizeForge(Entity entity, Pose pose, EntitySize size, float eyeHeight)static EntityEvent.SizegetEntitySizeForge(Entity entity, Pose pose, EntitySize oldSize, EntitySize newSize, float newEyeHeight)static intgetExperienceDrop(LivingEntity entity, PlayerEntity attackingPlayer, int originalExperience)static intgetItemBurnTime(ItemStack itemStack, int burnTime)Deprecated.static intgetItemBurnTime(ItemStack itemStack, int burnTime, IRecipeType<?> recipeType)static intgetMaxSpawnPackSize(MobEntity entity)static booleangetMobGriefingEvent(World world, Entity entity)static ITextComponentgetPlayerDisplayName(PlayerEntity player, ITextComponent username)static ITextComponentgetPlayerTabListDisplayName(PlayerEntity player)static java.util.List<MobSpawnInfo.Spawners>getPotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, java.util.List<MobSpawnInfo.Spawners> oldList)static LootTableloadLootTable(ResourceLocation name, LootTable table, LootTableManager lootTableManager)static booleanonAnimalTame(AnimalEntity animal, PlayerEntity tamer)static intonApplyBonemeal(PlayerEntity player, World world, BlockPos pos, BlockState state, ItemStack stack)static intonArrowLoose(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 booleanonBlockPlace(Entity entity, BlockSnapshot blockSnapshot, Direction direction)static ActionResult<ItemStack>onBucketUse(PlayerEntity player, World world, ItemStack stack, RayTraceResult target)static EntityTeleportEvent.ChorusFruitonChorusFruitTeleport(LivingEntity entity, double targetX, double targetY, double targetZ)static ITextComponentonClientChat(ChatType type, ITextComponent message, java.util.UUID senderUUID)static java.lang.StringonClientSendMessage(java.lang.String message)static voidonCommandRegister(com.mojang.brigadier.CommandDispatcher<CommandSource> dispatcher, Commands.EnvironmentType environment)static booleanonCreateWorldSpawn(World world, IServerWorldInfo settings)static intonEnchantmentLevelSet(World world, BlockPos pos, int enchantRow, int power, ItemStack itemStack, int level)static EntityTeleportEvent.EnderPearlonEnderPearlLand(ServerPlayerEntity entity, double targetX, double targetY, double targetZ, EnderPearlEntity pearlEntity, float attackDamage)static EntityTeleportEvent.EnderEntityonEnderTeleport(LivingEntity entity, double targetX, double targetY, double targetZ)static booleanonEntityDestroyBlock(LivingEntity entity, BlockPos pos, BlockState state)static booleanonEntityStruckByLightning(Entity entity, LightningBoltEntity bolt)static EntityTeleportEvent.TeleportCommandonEntityTeleportCommand(Entity entity, double targetX, double targetY, double targetZ)static EntityTeleportEvent.SpreadPlayersCommandonEntityTeleportSpreadPlayersCommand(Entity entity, double targetX, double targetY, double targetZ)static voidonExplosionDetonate(World world, Explosion explosion, java.util.List<Entity> list, double diameter)static booleanonExplosionStart(World world, Explosion explosion)static intonHoeUse(ItemUseContext context)Deprecated.static intonItemExpire(ItemEntity entity, ItemStack item)static intonItemPickup(ItemEntity entityItem, PlayerEntity player)static ItemTooltipEventonItemTooltip(ItemStack itemStack, PlayerEntity entityPlayer, java.util.List<ITextComponent> list, ITooltipFlag flags)static ItemStackonItemUseFinish(LivingEntity entity, ItemStack item, int duration, ItemStack result)static intonItemUseStart(LivingEntity entity, ItemStack item, int duration)static intonItemUseTick(LivingEntity entity, ItemStack item, int duration)static voidonLivingConvert(LivingEntity entity, LivingEntity outcome)static floatonLivingHeal(LivingEntity entity, float amount)static booleanonMultiBlockPlace(Entity entity, java.util.List<BlockSnapshot> blockSnapshots, Direction direction)static BlockEvent.NeighborNotifyEventonNeighborNotify(World world, BlockPos pos, BlockState state, java.util.EnumSet<Direction> notifiedSides, boolean forceRedstoneUpdate)private static floatonOldEnderTeleport(LivingEntity entity, float attackDamage, EntityTeleportEvent event)static booleanonPistonMovePost(World world, BlockPos pos, Direction direction, boolean extending)static booleanonPistonMovePre(World world, BlockPos pos, Direction direction, boolean extending)static voidonPlayerBrewedPotion(PlayerEntity player, ItemStack stack)static voidonPlayerClone(PlayerEntity player, PlayerEntity oldPlayer, boolean wasDeath)static voidonPlayerDestroyItem(PlayerEntity player, ItemStack stack, Hand hand)static voidonPlayerFall(PlayerEntity player, float distance, float multiplier)static PlayerEntity.SleepResultonPlayerSleepInBed(PlayerEntity player, java.util.Optional<BlockPos> pos)static booleanonPlayerSpawnSet(PlayerEntity player, RegistryKey<World> world, BlockPos pos, boolean forced)static voidonPlayerWakeup(PlayerEntity player, boolean wakeImmediately, boolean updateWorldFlag)static PlaySoundAtEntityEventonPlaySoundAtEntity(Entity entity, SoundEvent name, SoundCategory category, float volume, float pitch)static booleanonPotionAttemptBrew(NonNullList<ItemStack> stacks)static voidonPotionBrewed(NonNullList<ItemStack> brewingItemStacks)static booleanonProjectileImpact(Entity entity, RayTraceResult ray)static booleanonProjectileImpact(AbstractArrowEntity arrow, RayTraceResult ray)static booleanonProjectileImpact(DamagingProjectileEntity fireball, RayTraceResult ray)static booleanonProjectileImpact(FireworkRocketEntity fireworkRocket, RayTraceResult ray)static booleanonProjectileImpact(FishingBobberEntity fishingBobber, RayTraceResult ray)static booleanonProjectileImpact(ThrowableEntity throwable, RayTraceResult ray)static java.util.List<IFutureReloadListener>onResourceReload(DataPackRegistries dataPackRegistries)static longonSleepFinished(ServerWorld world, long newTime, long minTime)static voidonStartEntityTracking(Entity entity, PlayerEntity player)static voidonStopEntityTracking(Entity entity, PlayerEntity player)static BlockStateonToolUse(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 booleanonUseItemStop(LivingEntity entity, ItemStack item, int duration)static booleanrenderBlockOverlay(PlayerEntity player, MatrixStack mat, RenderBlockOverlayEvent.OverlayType type, BlockState block, BlockPos pos)static booleanrenderFireOverlay(PlayerEntity player, MatrixStack mat)static booleanrenderWaterOverlay(PlayerEntity player, MatrixStack mat)static booleansaplingGrowTree(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)
-
-