Package net.minecraftforge.event
Class ForgeEventFactory
java.lang.Object
net.minecraftforge.event.ForgeEventFactory
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancanCreateFluidSource(LevelReader world, BlockPos pos, BlockState state, boolean def)static net.minecraftforge.eventbus.api.Event.ResultcanEntityDespawn(Mob entity)static net.minecraftforge.eventbus.api.Event.ResultcanEntitySpawn(Mob entity, LevelAccessor world, double x, double y, double z, BaseSpawner spawner, MobSpawnType spawnReason)static booleancanEntitySpawnSpawner(Mob entity, Level world, float x, float y, float z, BaseSpawner 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(Player player, BlockState state, boolean success)static booleandoSpecialSpawn(Mob entity, Level world, float x, float y, float z, BaseSpawner spawner, MobSpawnType spawnReason)static voidfireChunkWatch(boolean wasLoaded, boolean load, ServerPlayer entity, ChunkPos chunkpos, ServerLevel world)static voidfireChunkWatch(boolean watch, ServerPlayer entity, ChunkPos chunkpos, ServerLevel world)static BlockStatefireFluidPlaceBlockEvent(LevelAccessor world, BlockPos pos, BlockPos liquidPos, BlockState state)static voidfirePlayerLoadingEvent(Player player, File playerDirectory, String uuidString)static voidfirePlayerLoadingEvent(Player player, PlayerDataStorage playerFileData, String uuidString)static voidfirePlayerSavingEvent(Player player, File playerDirectory, String uuidString)static booleanfireSleepingLocationCheck(LivingEntity player, BlockPos sleepingLocation)static booleanfireSleepingTimeCheck(Player player, Optional<BlockPos> sleepingLocation)static ZombieEvent.SummonAidEventfireZombieSummonAid(Zombie zombie, Level 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(Player player, BlockState state, float original, BlockPos pos)static EntityEvent.SizegetEntitySizeForge(Entity entity, Pose pose, EntityDimensions size, float eyeHeight)static EntityEvent.SizegetEntitySizeForge(Entity entity, Pose pose, EntityDimensions oldSize, EntityDimensions newSize, float newEyeHeight)static intgetExperienceDrop(LivingEntity entity, Player attackingPlayer, int originalExperience)static intgetItemBurnTime(ItemStack itemStack, int burnTime, RecipeType<?> recipeType)static intgetMaxSpawnPackSize(Mob entity)static booleangetMobGriefingEvent(Level world, Entity entity)static ComponentgetPlayerDisplayName(Player player, Component username)static ComponentgetPlayerTabListDisplayName(Player player)static LootTableloadLootTable(ResourceLocation name, LootTable table, LootTables lootTableManager)static booleanonAnimalTame(Animal animal, Player tamer)static intonApplyBonemeal(Player player, Level world, BlockPos pos, BlockState state, ItemStack stack)static intonArrowLoose(ItemStack stack, Level world, Player player, int charge, boolean hasAmmo)static InteractionResultHolder<ItemStack>onArrowNock(ItemStack item, Level world, Player player, InteractionHand hand, boolean hasAmmo)static booleanonBlockPlace(Entity entity, BlockSnapshot blockSnapshot, Direction direction)static InteractionResultHolder<ItemStack>onBucketUse(Player player, Level world, ItemStack stack, HitResult target)onChorusFruitTeleport(LivingEntity entity, double targetX, double targetY, double targetZ)static ComponentonClientChat(ChatType type, Component message, UUID senderUUID)static StringonClientSendMessage(String message)static voidonCommandRegister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, Commands.CommandSelection environment)static booleanonCreateWorldSpawn(Level world, ServerLevelData settings)static intonEnchantmentLevelSet(Level world, BlockPos pos, int enchantRow, int power, ItemStack itemStack, int level)onEnderPearlLand(ServerPlayer entity, double targetX, double targetY, double targetZ, ThrownEnderpearl pearlEntity, float attackDamage)onEnderTeleport(LivingEntity entity, double targetX, double targetY, double targetZ)static booleanonEntityDestroyBlock(LivingEntity entity, BlockPos pos, BlockState state)static booleanonEntityStruckByLightning(Entity entity, LightningBolt bolt)onEntityTeleportCommand(Entity entity, double targetX, double targetY, double targetZ)onEntityTeleportSpreadPlayersCommand(Entity entity, double targetX, double targetY, double targetZ)static voidonExplosionDetonate(Level world, Explosion explosion, List<Entity> list, double diameter)static booleanonExplosionStart(Level world, Explosion explosion)static intonHoeUse(UseOnContext context)Deprecated.static intonItemExpire(ItemEntity entity, ItemStack item)static intonItemPickup(ItemEntity entityItem, Player player)static ItemTooltipEventonItemTooltip(ItemStack itemStack, Player entityPlayer, List<Component> list, TooltipFlag 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(Level world, BlockPos pos, BlockState state, EnumSet<Direction> notifiedSides, boolean forceRedstoneUpdate)static booleanonPermissionChanged(com.mojang.authlib.GameProfile gameProfile, int newLevel, PlayerList playerList)static booleanonPistonMovePost(Level world, BlockPos pos, Direction direction, boolean extending)static booleanonPistonMovePre(Level world, BlockPos pos, Direction direction, boolean extending)static voidonPlayerBrewedPotion(Player player, ItemStack stack)static voidonPlayerClone(Player player, Player oldPlayer, boolean wasDeath)static voidonPlayerDestroyItem(Player player, ItemStack stack, InteractionHand hand)static voidonPlayerFall(Player player, float distance, float multiplier)static Player.BedSleepingProblemonPlayerSleepInBed(Player player, Optional<BlockPos> pos)static booleanonPlayerSpawnSet(Player player, ResourceKey<Level> world, BlockPos pos, boolean forced)static voidonPlayerWakeup(Player player, boolean wakeImmediately, boolean updateWorldFlag)static PlaySoundAtEntityEventonPlaySoundAtEntity(Entity entity, SoundEvent name, SoundSource category, float volume, float pitch)static booleanonPotionAttemptBrew(NonNullList<ItemStack> stacks)static voidonPotionBrewed(NonNullList<ItemStack> brewingItemStacks)static booleanonProjectileImpact(Projectile projectile, HitResult ray)static List<PreparableReloadListener>onResourceReload(ServerResources dataPackRegistries)static longonSleepFinished(ServerLevel world, long newTime, long minTime)static voidonStartEntityTracking(Entity entity, Player player)static voidonStopEntityTracking(Entity entity, Player player)static BlockStateonToolUse(BlockState originalState, Level world, BlockPos pos, Player player, ItemStack stack, ToolAction toolAction)static Optional<PortalShape>onTrySpawnPortal(LevelAccessor world, BlockPos pos, Optional<PortalShape> size)static booleanonUseItemStop(LivingEntity entity, ItemStack item, int duration)static booleanrenderBlockOverlay(Player player, PoseStack mat, RenderBlockOverlayEvent.OverlayType type, BlockState block, BlockPos pos)static booleanrenderFireOverlay(Player player, PoseStack mat)static booleanrenderWaterOverlay(Player player, PoseStack mat)static booleansaplingGrowTree(LevelAccessor 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(Level world, BlockPos pos, BlockState state, EnumSet<Direction> notifiedSides, boolean forceRedstoneUpdate) -
doPlayerHarvestCheck
-
getBreakSpeed
-
onPlayerDestroyItem
public static void onPlayerDestroyItem(Player player, @Nonnull ItemStack stack, @Nullable InteractionHand hand) -
canEntitySpawn
public static net.minecraftforge.eventbus.api.Event.Result canEntitySpawn(Mob entity, LevelAccessor world, double x, double y, double z, BaseSpawner spawner, MobSpawnType spawnReason) -
canEntitySpawnSpawner
public static boolean canEntitySpawnSpawner(Mob entity, Level world, float x, float y, float z, BaseSpawner spawner) -
doSpecialSpawn
public static boolean doSpecialSpawn(Mob entity, Level world, float x, float y, float z, BaseSpawner spawner, MobSpawnType spawnReason) -
canEntityDespawn
-
getItemBurnTime
public static int getItemBurnTime(@Nonnull ItemStack itemStack, int burnTime, @Nullable RecipeType<?> recipeType) -
getExperienceDrop
public static int getExperienceDrop(LivingEntity entity, Player attackingPlayer, int originalExperience) -
getMaxSpawnPackSize
-
getPlayerDisplayName
-
getPlayerTabListDisplayName
-
fireFluidPlaceBlockEvent
public static BlockState fireFluidPlaceBlockEvent(LevelAccessor world, BlockPos pos, BlockPos liquidPos, BlockState state) -
onItemTooltip
public static ItemTooltipEvent onItemTooltip(ItemStack itemStack, @Nullable Player entityPlayer, List<Component> list, TooltipFlag flags) -
fireZombieSummonAid
public static ZombieEvent.SummonAidEvent fireZombieSummonAid(Zombie zombie, Level 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
-
firePlayerSavingEvent
-
firePlayerLoadingEvent
public static void firePlayerLoadingEvent(Player player, PlayerDataStorage playerFileData, String uuidString) -
onClientChat
-
onClientSendMessage
-
onHoeUse
Deprecated. -
onToolUse
@Nullable public static BlockState onToolUse(BlockState originalState, Level world, BlockPos pos, Player player, ItemStack stack, ToolAction toolAction) -
onApplyBonemeal
public static int onApplyBonemeal(@Nonnull Player player, @Nonnull Level world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull ItemStack stack) -
onBucketUse
-
canEntityUpdate
-
onPlaySoundAtEntity
public static PlaySoundAtEntityEvent onPlaySoundAtEntity(Entity entity, SoundEvent name, SoundSource category, float volume, float pitch) -
onItemExpire
-
onItemPickup
-
canMountEntity
-
onAnimalTame
-
onPlayerSleepInBed
-
onPlayerWakeup
-
onPlayerFall
-
onPlayerSpawnSet
public static boolean onPlayerSpawnSet(Player player, ResourceKey<Level> world, BlockPos pos, boolean forced) -
onPlayerClone
-
onExplosionStart
-
onExplosionDetonate
-
onCreateWorldSpawn
-
onLivingHeal
-
onPotionAttemptBrew
-
onPotionBrewed
-
onPlayerBrewedPotion
-
renderFireOverlay
-
renderWaterOverlay
-
renderBlockOverlay
public static boolean renderBlockOverlay(Player player, PoseStack 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
-
onArrowNock
public static InteractionResultHolder<ItemStack> onArrowNock(ItemStack item, Level world, Player player, InteractionHand hand, boolean hasAmmo) -
onArrowLoose
-
onProjectileImpact
-
loadLootTable
public static LootTable loadLootTable(ResourceLocation name, LootTable table, LootTables lootTableManager) -
canCreateFluidSource
public static boolean canCreateFluidSource(LevelReader world, BlockPos pos, BlockState state, boolean def) -
onTrySpawnPortal
public static Optional<PortalShape> onTrySpawnPortal(LevelAccessor world, BlockPos pos, Optional<PortalShape> size) -
onEnchantmentLevelSet
-
onEntityDestroyBlock
-
getMobGriefingEvent
-
saplingGrowTree
-
fireChunkWatch
public static void fireChunkWatch(boolean watch, ServerPlayer entity, ChunkPos chunkpos, ServerLevel world) -
fireChunkWatch
public static void fireChunkWatch(boolean wasLoaded, boolean load, ServerPlayer entity, ChunkPos chunkpos, ServerLevel world) -
onPistonMovePre
-
onPistonMovePost
-
onSleepFinished
-
onResourceReload
-
onCommandRegister
public static void onCommandRegister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, Commands.CommandSelection environment) -
getEntitySizeForge
public static EntityEvent.Size getEntitySizeForge(Entity entity, Pose pose, EntityDimensions size, float eyeHeight) -
getEntitySizeForge
public static EntityEvent.Size getEntitySizeForge(Entity entity, Pose pose, EntityDimensions oldSize, EntityDimensions 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(ServerPlayer entity, double targetX, double targetY, double targetZ, ThrownEnderpearl pearlEntity, float attackDamage) -
onChorusFruitTeleport
public static EntityTeleportEvent.ChorusFruit onChorusFruitTeleport(LivingEntity entity, double targetX, double targetY, double targetZ) -
onPermissionChanged
public static boolean onPermissionChanged(com.mojang.authlib.GameProfile gameProfile, int newLevel, PlayerList playerList)
-