Package net.minecraftforge.event
Class ForgeEventFactory
java.lang.Object
net.minecraftforge.event.ForgeEventFactory
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
canCreateFluidSource(LevelReader world, BlockPos pos, BlockState state, boolean def)
static net.minecraftforge.eventbus.api.Event.Result
canEntityDespawn(Mob entity)
static net.minecraftforge.eventbus.api.Event.Result
canEntitySpawn(Mob entity, LevelAccessor world, double x, double y, double z, BaseSpawner spawner, MobSpawnType spawnReason)
static boolean
canEntitySpawnSpawner(Mob entity, Level world, float x, float y, float z, BaseSpawner 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(Player player, BlockState state, boolean success)
static boolean
doSpecialSpawn(Mob entity, Level world, float x, float y, float z, BaseSpawner spawner, MobSpawnType spawnReason)
static void
fireChunkWatch(boolean wasLoaded, boolean load, ServerPlayer entity, ChunkPos chunkpos, ServerLevel world)
static void
fireChunkWatch(boolean watch, ServerPlayer entity, ChunkPos chunkpos, ServerLevel world)
static BlockState
fireFluidPlaceBlockEvent(LevelAccessor world, BlockPos pos, BlockPos liquidPos, BlockState state)
static void
firePlayerLoadingEvent(Player player, File playerDirectory, String uuidString)
static void
firePlayerLoadingEvent(Player player, PlayerDataStorage playerFileData, String uuidString)
static void
firePlayerSavingEvent(Player player, File playerDirectory, String uuidString)
static boolean
fireSleepingLocationCheck(LivingEntity player, BlockPos sleepingLocation)
static boolean
fireSleepingTimeCheck(Player player, Optional<BlockPos> sleepingLocation)
static ZombieEvent.SummonAidEvent
fireZombieSummonAid(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 CapabilityDispatcher
gatherCapabilities(AttachCapabilitiesEvent<?> event, ICapabilityProvider parent)
static float
getBreakSpeed(Player player, BlockState state, float original, BlockPos pos)
static EntityEvent.Size
getEntitySizeForge(Entity entity, Pose pose, EntityDimensions size, float eyeHeight)
static EntityEvent.Size
getEntitySizeForge(Entity entity, Pose pose, EntityDimensions oldSize, EntityDimensions newSize, float newEyeHeight)
static int
getExperienceDrop(LivingEntity entity, Player attackingPlayer, int originalExperience)
static int
getItemBurnTime(ItemStack itemStack, int burnTime, RecipeType<?> recipeType)
static int
getMaxSpawnPackSize(Mob entity)
static boolean
getMobGriefingEvent(Level world, Entity entity)
static Component
getPlayerDisplayName(Player player, Component username)
static Component
getPlayerTabListDisplayName(Player player)
static LootTable
loadLootTable(ResourceLocation name, LootTable table, LootTables lootTableManager)
static boolean
onAnimalTame(Animal animal, Player tamer)
static int
onApplyBonemeal(Player player, Level world, BlockPos pos, BlockState state, ItemStack stack)
static int
onArrowLoose(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 boolean
onBlockPlace(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 Component
onClientChat(ChatType type, Component message, UUID senderUUID)
static String
onClientSendMessage(String message)
static void
onCommandRegister(com.mojang.brigadier.CommandDispatcher<CommandSourceStack> dispatcher, Commands.CommandSelection environment)
static boolean
onCreateWorldSpawn(Level world, ServerLevelData settings)
static int
onEnchantmentLevelSet(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 boolean
onEntityDestroyBlock(LivingEntity entity, BlockPos pos, BlockState state)
static boolean
onEntityStruckByLightning(Entity entity, LightningBolt bolt)
onEntityTeleportCommand(Entity entity, double targetX, double targetY, double targetZ)
onEntityTeleportSpreadPlayersCommand(Entity entity, double targetX, double targetY, double targetZ)
static void
onExplosionDetonate(Level world, Explosion explosion, List<Entity> list, double diameter)
static boolean
onExplosionStart(Level world, Explosion explosion)
static int
onHoeUse(UseOnContext context)
Deprecated.static int
onItemExpire(ItemEntity entity, ItemStack item)
static int
onItemPickup(ItemEntity entityItem, Player player)
static ItemTooltipEvent
onItemTooltip(ItemStack itemStack, Player entityPlayer, List<Component> list, TooltipFlag 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(Level world, BlockPos pos, BlockState state, EnumSet<Direction> notifiedSides, boolean forceRedstoneUpdate)
static boolean
onPermissionChanged(com.mojang.authlib.GameProfile gameProfile, int newLevel, PlayerList playerList)
static boolean
onPistonMovePost(Level world, BlockPos pos, Direction direction, boolean extending)
static boolean
onPistonMovePre(Level world, BlockPos pos, Direction direction, boolean extending)
static void
onPlayerBrewedPotion(Player player, ItemStack stack)
static void
onPlayerClone(Player player, Player oldPlayer, boolean wasDeath)
static void
onPlayerDestroyItem(Player player, ItemStack stack, InteractionHand hand)
static void
onPlayerFall(Player player, float distance, float multiplier)
static Player.BedSleepingProblem
onPlayerSleepInBed(Player player, Optional<BlockPos> pos)
static boolean
onPlayerSpawnSet(Player player, ResourceKey<Level> world, BlockPos pos, boolean forced)
static void
onPlayerWakeup(Player player, boolean wakeImmediately, boolean updateWorldFlag)
static PlaySoundAtEntityEvent
onPlaySoundAtEntity(Entity entity, SoundEvent name, SoundSource category, float volume, float pitch)
static boolean
onPotionAttemptBrew(NonNullList<ItemStack> stacks)
static void
onPotionBrewed(NonNullList<ItemStack> brewingItemStacks)
static boolean
onProjectileImpact(Projectile projectile, HitResult ray)
static List<PreparableReloadListener>
onResourceReload(ServerResources dataPackRegistries)
static long
onSleepFinished(ServerLevel world, long newTime, long minTime)
static void
onStartEntityTracking(Entity entity, Player player)
static void
onStopEntityTracking(Entity entity, Player player)
static BlockState
onToolUse(BlockState originalState, Level world, BlockPos pos, Player player, ItemStack stack, ToolAction toolAction)
static Optional<PortalShape>
onTrySpawnPortal(LevelAccessor world, BlockPos pos, Optional<PortalShape> size)
static boolean
onUseItemStop(LivingEntity entity, ItemStack item, int duration)
static boolean
renderBlockOverlay(Player player, PoseStack mat, RenderBlockOverlayEvent.OverlayType type, BlockState block, BlockPos pos)
static boolean
renderFireOverlay(Player player, PoseStack mat)
static boolean
renderWaterOverlay(Player player, PoseStack mat)
static boolean
saplingGrowTree(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)
-