Package net.minecraftforge.event
Class ForgeEventFactory
java.lang.Object
net.minecraftforge.event.ForgeEventFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic 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, Consumer<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, File playerDirectory, String uuidString) static voidfirePlayerLoadingEvent(PlayerEntity player, PlayerData playerFileData, String uuidString) static voidfirePlayerSavingEvent(PlayerEntity player, File playerDirectory, String uuidString) static booleanfireSleepingLocationCheck(LivingEntity player, BlockPos sleepingLocation) static booleanfireSleepingTimeCheck(PlayerEntity player, 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(Class<? extends T> type, T provider) static <T extends ICapabilityProvider>
CapabilityDispatchergatherCapabilities(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 ITextComponentstatic List<MobSpawnInfo.Spawners>getPotentialSpawns(IWorld world, EntityClassification type, BlockPos pos, 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) onChorusFruitTeleport(LivingEntity entity, double targetX, double targetY, double targetZ) static ITextComponentonClientChat(ChatType type, ITextComponent message, UUID senderUUID) static StringonClientSendMessage(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) onEnderPearlLand(ServerPlayerEntity entity, double targetX, double targetY, double targetZ, EnderPearlEntity pearlEntity, float attackDamage) onEnderTeleport(LivingEntity entity, double targetX, double targetY, double targetZ) static booleanonEntityDestroyBlock(LivingEntity entity, BlockPos pos, BlockState state) static booleanonEntityStruckByLightning(Entity entity, LightningBoltEntity bolt) onEntityTeleportCommand(Entity entity, double targetX, double targetY, double targetZ) onEntityTeleportSpreadPlayersCommand(Entity entity, double targetX, double targetY, double targetZ) static voidonExplosionDetonate(World world, Explosion explosion, 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, 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, List<BlockSnapshot> blockSnapshots, Direction direction) onNeighborNotify(World world, BlockPos pos, BlockState state, 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, 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 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 Optional<PortalSize>onTrySpawnPortal(IWorld world, BlockPos pos, 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, 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)
-