Class NeoForgeMod

java.lang.Object
net.neoforged.neoforge.common.NeoForgeMod

public class NeoForgeMod extends Object
  • Field Details

    • VERSION_CHECK_CAT

      public static final String VERSION_CHECK_CAT
      See Also:
    • LOGGER

      private static final org.apache.logging.log4j.Logger LOGGER
    • NEOFORGEMOD

      private static final org.apache.logging.log4j.Marker NEOFORGEMOD
    • isPRBuild

      private static boolean isPRBuild
    • ATTRIBUTES

      private static final DeferredRegister<net.minecraft.world.entity.ai.attributes.Attribute> ATTRIBUTES
    • COMMAND_ARGUMENT_TYPES

      private static final DeferredRegister<net.minecraft.commands.synchronization.ArgumentTypeInfo<?,?>> COMMAND_ARGUMENT_TYPES
    • GLOBAL_LOOT_MODIFIER_SERIALIZERS

      private static final DeferredRegister<com.mojang.serialization.MapCodec<? extends IGlobalLootModifier>> GLOBAL_LOOT_MODIFIER_SERIALIZERS
    • BIOME_MODIFIER_SERIALIZERS

      private static final DeferredRegister<com.mojang.serialization.MapCodec<? extends BiomeModifier>> BIOME_MODIFIER_SERIALIZERS
    • STRUCTURE_MODIFIER_SERIALIZERS

      private static final DeferredRegister<com.mojang.serialization.MapCodec<? extends StructureModifier>> STRUCTURE_MODIFIER_SERIALIZERS
    • HOLDER_SET_TYPES

      private static final DeferredRegister<HolderSetType> HOLDER_SET_TYPES
    • ENUM_COMMAND_ARGUMENT_TYPE

      private static final net.minecraft.core.Holder<net.minecraft.commands.synchronization.ArgumentTypeInfo<?,?>> ENUM_COMMAND_ARGUMENT_TYPE
    • MODID_COMMAND_ARGUMENT_TYPE

      private static final DeferredHolder<net.minecraft.commands.synchronization.ArgumentTypeInfo<?,?>,net.minecraft.commands.synchronization.SingletonArgumentInfo<ModIdArgument>> MODID_COMMAND_ARGUMENT_TYPE
    • SWIM_SPEED

      public static final net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> SWIM_SPEED
    • NAMETAG_DISTANCE

      public static final net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> NAMETAG_DISTANCE
    • CREATIVE_FLIGHT

      public static final net.minecraft.core.Holder<net.minecraft.world.entity.ai.attributes.Attribute> CREATIVE_FLIGHT
      This attribute controls if the player may use creative flight when not in creative mode.

      This is a BooleanAttribute, and should only be modified using the standards established by that class.

      To determine if a player may fly (either via game mode or attribute), use IPlayerExtension.mayFly()

      Game mode flight cannot be disabled via this attribute.

    • ADD_TABLE_LOOT_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends IGlobalLootModifier>,com.mojang.serialization.MapCodec<AddTableLootModifier>> ADD_TABLE_LOOT_MODIFIER_TYPE
      Stock loot modifier type that adds loot from a subtable to the final loot.
    • NONE_BIOME_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends BiomeModifier>,com.mojang.serialization.MapCodec<NoneBiomeModifier>> NONE_BIOME_MODIFIER_TYPE
      Noop biome modifier. Can be used in a biome modifier json with "type": "neoforge:none".
    • ADD_FEATURES_BIOME_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends BiomeModifier>,com.mojang.serialization.MapCodec<BiomeModifiers.AddFeaturesBiomeModifier>> ADD_FEATURES_BIOME_MODIFIER_TYPE
      Stock biome modifier for adding features to biomes.
    • REMOVE_FEATURES_BIOME_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends BiomeModifier>,com.mojang.serialization.MapCodec<BiomeModifiers.RemoveFeaturesBiomeModifier>> REMOVE_FEATURES_BIOME_MODIFIER_TYPE
      Stock biome modifier for removing features from biomes.
    • ADD_SPAWNS_BIOME_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends BiomeModifier>,com.mojang.serialization.MapCodec<BiomeModifiers.AddSpawnsBiomeModifier>> ADD_SPAWNS_BIOME_MODIFIER_TYPE
      Stock biome modifier for adding mob spawns to biomes.
    • REMOVE_SPAWNS_BIOME_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends BiomeModifier>,com.mojang.serialization.MapCodec<BiomeModifiers.RemoveSpawnsBiomeModifier>> REMOVE_SPAWNS_BIOME_MODIFIER_TYPE
      Stock biome modifier for removing mob spawns from biomes.
    • ADD_CARVERS_BIOME_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends BiomeModifier>,com.mojang.serialization.MapCodec<BiomeModifiers.AddCarversBiomeModifier>> ADD_CARVERS_BIOME_MODIFIER_TYPE
      Stock biome modifier for adding carvers to biomes.
    • REMOVE_CARVERS_BIOME_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends BiomeModifier>,com.mojang.serialization.MapCodec<BiomeModifiers.RemoveCarversBiomeModifier>> REMOVE_CARVERS_BIOME_MODIFIER_TYPE
      Stock biome modifier for removing carvers from biomes.
    • ADD_SPAWN_COSTS_BIOME_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends BiomeModifier>,com.mojang.serialization.MapCodec<BiomeModifiers.AddSpawnCostsBiomeModifier>> ADD_SPAWN_COSTS_BIOME_MODIFIER_TYPE
      Stock biome modifier for adding mob spawn costs to biomes.
    • REMOVE_SPAWN_COSTS_BIOME_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends BiomeModifier>,com.mojang.serialization.MapCodec<BiomeModifiers.RemoveSpawnCostsBiomeModifier>> REMOVE_SPAWN_COSTS_BIOME_MODIFIER_TYPE
      Stock biome modifier for removing mob spawn costs from biomes.
    • NONE_STRUCTURE_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends StructureModifier>,com.mojang.serialization.MapCodec<NoneStructureModifier>> NONE_STRUCTURE_MODIFIER_TYPE
      Noop structure modifier. Can be used in a structure modifier json with "type": "neoforge:none".
    • ADD_SPAWNS_STRUCTURE_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends StructureModifier>,com.mojang.serialization.MapCodec<StructureModifiers.AddSpawnsStructureModifier>> ADD_SPAWNS_STRUCTURE_MODIFIER_TYPE
      Stock structure modifier for adding mob spawns to structures.
    • REMOVE_SPAWNS_STRUCTURE_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends StructureModifier>,com.mojang.serialization.MapCodec<StructureModifiers.RemoveSpawnsStructureModifier>> REMOVE_SPAWNS_STRUCTURE_MODIFIER_TYPE
      Stock structure modifier for removing mob spawns from structures.
    • CLEAR_SPAWNS_STRUCTURE_MODIFIER_TYPE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends StructureModifier>,com.mojang.serialization.MapCodec<StructureModifiers.ClearSpawnsStructureModifier>> CLEAR_SPAWNS_STRUCTURE_MODIFIER_TYPE
      Stock structure modifier for removing spawn override lists from structures.
    • ANY_HOLDER_SET

      public static final net.minecraft.core.Holder<HolderSetType> ANY_HOLDER_SET
      Stock holder set type that represents any/all values in a registry. Can be used in a holderset object with { "type": "neoforge:any" }
    • AND_HOLDER_SET

      public static final net.minecraft.core.Holder<HolderSetType> AND_HOLDER_SET
      Stock holder set type that represents an intersection of other holdersets. Can be used in a holderset object with { "type": "neoforge:and", "values": [list of holdersets] }
    • OR_HOLDER_SET

      public static final net.minecraft.core.Holder<HolderSetType> OR_HOLDER_SET
      Stock holder set type that represents a union of other holdersets. Can be used in a holderset object with { "type": "neoforge:or", "values": [list of holdersets] }
    • NOT_HOLDER_SET

      public static final net.minecraft.core.Holder<HolderSetType> NOT_HOLDER_SET

      Stock holder set type that represents all values in a registry except those in another given set. Can be used in a holderset object with { "type": "neoforge:not", "value": holderset }

    • SLOT_DISPLAY_TYPES

      private static final DeferredRegister<net.minecraft.world.item.crafting.display.SlotDisplay.Type<?>> SLOT_DISPLAY_TYPES
    • FLUID_SLOT_DISPLAY

      public static final DeferredHolder<net.minecraft.world.item.crafting.display.SlotDisplay.Type<?>,net.minecraft.world.item.crafting.display.SlotDisplay.Type<FluidSlotDisplay>> FLUID_SLOT_DISPLAY
    • FLUID_STACK_SLOT_DISPLAY

      public static final DeferredHolder<net.minecraft.world.item.crafting.display.SlotDisplay.Type<?>,net.minecraft.world.item.crafting.display.SlotDisplay.Type<FluidStackSlotDisplay>> FLUID_STACK_SLOT_DISPLAY
    • FLUID_TAG_SLOT_DISPLAY

      public static final DeferredHolder<net.minecraft.world.item.crafting.display.SlotDisplay.Type<?>,net.minecraft.world.item.crafting.display.SlotDisplay.Type<FluidTagSlotDisplay>> FLUID_TAG_SLOT_DISPLAY
    • INGREDIENT_TYPES

      private static final DeferredRegister<IngredientType<?>> INGREDIENT_TYPES
    • COMPOUND_INGREDIENT_TYPE

      public static final DeferredHolder<IngredientType<?>,IngredientType<CompoundIngredient>> COMPOUND_INGREDIENT_TYPE
    • DATA_COMPONENT_INGREDIENT_TYPE

      public static final DeferredHolder<IngredientType<?>,IngredientType<DataComponentIngredient>> DATA_COMPONENT_INGREDIENT_TYPE
    • DIFFERENCE_INGREDIENT_TYPE

      public static final DeferredHolder<IngredientType<?>,IngredientType<DifferenceIngredient>> DIFFERENCE_INGREDIENT_TYPE
    • INTERSECTION_INGREDIENT_TYPE

      public static final DeferredHolder<IngredientType<?>,IngredientType<IntersectionIngredient>> INTERSECTION_INGREDIENT_TYPE
    • BLOCK_TAG_INGREDIENT

      public static final DeferredHolder<IngredientType<?>,IngredientType<BlockTagIngredient>> BLOCK_TAG_INGREDIENT
    • CUSTOM_DISPLAY_INGREDIENT

      public static final DeferredHolder<IngredientType<?>,IngredientType<CustomDisplayIngredient>> CUSTOM_DISPLAY_INGREDIENT
    • FLUID_INGREDIENT_TYPES

      private static final DeferredRegister<FluidIngredientType<?>> FLUID_INGREDIENT_TYPES
    • SIMPLE_FLUID_INGREDIENT_TYPE

      public static final DeferredHolder<FluidIngredientType<?>,FluidIngredientType<SimpleFluidIngredient>> SIMPLE_FLUID_INGREDIENT_TYPE
    • COMPOUND_FLUID_INGREDIENT_TYPE

      public static final DeferredHolder<FluidIngredientType<?>,FluidIngredientType<CompoundFluidIngredient>> COMPOUND_FLUID_INGREDIENT_TYPE
    • DATA_COMPONENT_FLUID_INGREDIENT_TYPE

      public static final DeferredHolder<FluidIngredientType<?>,FluidIngredientType<DataComponentFluidIngredient>> DATA_COMPONENT_FLUID_INGREDIENT_TYPE
    • DIFFERENCE_FLUID_INGREDIENT_TYPE

      public static final DeferredHolder<FluidIngredientType<?>,FluidIngredientType<DifferenceFluidIngredient>> DIFFERENCE_FLUID_INGREDIENT_TYPE
    • INTERSECTION_FLUID_INGREDIENT_TYPE

      public static final DeferredHolder<FluidIngredientType<?>,FluidIngredientType<IntersectionFluidIngredient>> INTERSECTION_FLUID_INGREDIENT_TYPE
    • CUSTOM_DISPLAY_FLUID_INGREDIENT

      public static final DeferredHolder<FluidIngredientType<?>,FluidIngredientType<CustomDisplayFluidIngredient>> CUSTOM_DISPLAY_FLUID_INGREDIENT
    • CONDITION_CODECS

      private static final DeferredRegister<com.mojang.serialization.MapCodec<? extends ICondition>> CONDITION_CODECS
    • AND_CONDITION

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<AndCondition>> AND_CONDITION
    • NEVER_CONDITION

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<NeverCondition>> NEVER_CONDITION
    • REGISTERED_CONDITION

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<RegisteredCondition<?>>> REGISTERED_CONDITION
    • MOD_LOADED_CONDITION

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<ModLoadedCondition>> MOD_LOADED_CONDITION
    • NOT_CONDITION

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<NotCondition>> NOT_CONDITION
    • OR_CONDITION

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<OrCondition>> OR_CONDITION
    • TAG_EMPTY_CONDITION

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<TagEmptyCondition<?>>> TAG_EMPTY_CONDITION
    • ALWAYS_CONDITION

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<AlwaysCondition>> ALWAYS_CONDITION
    • FEATURE_FLAGS_ENABLED_CONDITION

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<FeatureFlagsEnabledCondition>> FEATURE_FLAGS_ENABLED_CONDITION
    • ENTITY_PREDICATE_CODECS

      private static final DeferredRegister<com.mojang.serialization.MapCodec<? extends net.minecraft.advancements.critereon.EntitySubPredicate>> ENTITY_PREDICATE_CODECS
    • PIGLIN_NEUTRAL_ARMOR_PREDICATE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends net.minecraft.advancements.critereon.EntitySubPredicate>,com.mojang.serialization.MapCodec<PiglinNeutralArmorEntityPredicate>> PIGLIN_NEUTRAL_ARMOR_PREDICATE
    • SNOW_BOOTS_PREDICATE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends net.minecraft.advancements.critereon.EntitySubPredicate>,com.mojang.serialization.MapCodec<SnowBootsEntityPredicate>> SNOW_BOOTS_PREDICATE
    • IS_TRIDENT_PREDICATE

      public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends net.minecraft.advancements.critereon.EntitySubPredicate>,com.mojang.serialization.MapCodec<TridentEntityPredicate>> IS_TRIDENT_PREDICATE
    • DATA_COMPONENT_PREDICATE_TYPES

      private static final DeferredRegister<net.minecraft.core.component.predicates.DataComponentPredicate.Type<?>> DATA_COMPONENT_PREDICATE_TYPES
    • ITEM_ABILITY_PREDICATE

      public static final DeferredHolder<net.minecraft.core.component.predicates.DataComponentPredicate.Type<?>,net.minecraft.core.component.predicates.DataComponentPredicate.Type<ItemAbilityPredicate>> ITEM_ABILITY_PREDICATE
    • PIGLIN_CURRENCY_PREDICATE

      public static final DeferredHolder<net.minecraft.core.component.predicates.DataComponentPredicate.Type<?>,net.minecraft.core.component.predicates.DataComponentPredicate.Type<PiglinCurrencyItemPredicate>> PIGLIN_CURRENCY_PREDICATE
    • TICKET_TYPES

      private static final DeferredRegister<net.minecraft.server.level.TicketType> TICKET_TYPES
    • GENERATE_FORCED_TICKET

      public static final net.minecraft.core.Holder<net.minecraft.server.level.TicketType> GENERATE_FORCED_TICKET
    • BLOCK_TICKET

      public static final net.minecraft.core.Holder<net.minecraft.server.level.TicketType> BLOCK_TICKET
    • BLOCK_WITH_NATURAL_SPAWNING_TICKET

      public static final net.minecraft.core.Holder<net.minecraft.server.level.TicketType> BLOCK_WITH_NATURAL_SPAWNING_TICKET
    • ENTITY_TICKET

      public static final net.minecraft.core.Holder<net.minecraft.server.level.TicketType> ENTITY_TICKET
    • ENTITY_WITH_NATURAL_SPAWNING_TICKET

      public static final net.minecraft.core.Holder<net.minecraft.server.level.TicketType> ENTITY_WITH_NATURAL_SPAWNING_TICKET
    • VANILLA_FLUID_TYPES

      private static final DeferredRegister<FluidType> VANILLA_FLUID_TYPES
    • EMPTY_TYPE

      public static final net.minecraft.core.Holder<FluidType> EMPTY_TYPE
    • WATER_TYPE

      public static final net.minecraft.core.Holder<FluidType> WATER_TYPE
    • LAVA_TYPE

      public static final net.minecraft.core.Holder<FluidType> LAVA_TYPE
    • enableProperFilenameValidation

      private static boolean enableProperFilenameValidation
    • enableMilkFluid

      private static boolean enableMilkFluid
    • enableMergedAttributeTooltips

      private static boolean enableMergedAttributeTooltips
    • BUCKET_EMPTY_MILK

      public static final DeferredHolder<net.minecraft.sounds.SoundEvent,net.minecraft.sounds.SoundEvent> BUCKET_EMPTY_MILK
    • BUCKET_FILL_MILK

      public static final DeferredHolder<net.minecraft.sounds.SoundEvent,net.minecraft.sounds.SoundEvent> BUCKET_FILL_MILK
    • MILK_TYPE

      public static final DeferredHolder<FluidType,FluidType> MILK_TYPE
    • MILK

      public static final DeferredHolder<net.minecraft.world.level.material.Fluid,net.minecraft.world.level.material.Fluid> MILK
    • FLOWING_MILK

      public static final DeferredHolder<net.minecraft.world.level.material.Fluid,net.minecraft.world.level.material.Fluid> FLOWING_MILK
    • POISON_DAMAGE

      public static final net.minecraft.resources.ResourceKey<net.minecraft.world.damagesource.DamageType> POISON_DAMAGE
      Used in place of DamageSources.magic() for damage dealt by MobEffects.POISON.

      May also be used by mods providing poison-like effects.

      See Also:
    • USE_SELECTORS_PERMISSION

      public static final PermissionNode<Boolean> USE_SELECTORS_PERMISSION
  • Constructor Details

    • NeoForgeMod

      public NeoForgeMod(net.neoforged.bus.api.IEventBus modEventBus, net.neoforged.api.distmarker.Dist dist, net.neoforged.fml.ModContainer container)
  • Method Details

    • enableMilkFluid

      public static void enableMilkFluid()
      Run this method during mod constructor to enable milk and add it to the Minecraft milk bucket
    • enableMergedAttributeTooltips

      public static void enableMergedAttributeTooltips()
      Run this during mod construction to enable merged attribute tooltip functionality.
    • enableProperFilenameValidation

      public static void enableProperFilenameValidation()
      Run this method during mod constructor to enable FileUtil.RESERVED_WINDOWS_FILENAMES_NEOFORGE regex being used for filepath validation. Fixes MC-268617 at cost of vanilla incompat edge cases with files generated with this activated and them migrated to vanilla instance - See PR #767
    • getProperFilenameValidation

      public static boolean getProperFilenameValidation()
    • shouldMergeAttributeTooltips

      public static boolean shouldMergeAttributeTooltips()
    • preInit

      public void preInit(net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent evt)
    • loadComplete

      public void loadComplete(net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent event)
    • serverStopping

      public void serverStopping(ServerStoppingEvent evt)
    • registerFluids

      public void registerFluids(RegisterEvent event)
    • registerLootData

      public void registerLootData(RegisterEvent event)
    • onConfigLoad

      private static void onConfigLoad(net.neoforged.fml.event.config.ModConfigEvent.Loading configEvent)
    • onConfigFileChange

      private static void onConfigFileChange(net.neoforged.fml.event.config.ModConfigEvent.Reloading configEvent)
    • registerPermissionNodes

      public void registerPermissionNodes(PermissionGatherEvent.Nodes event)
    • isPRBuild

      private static boolean isPRBuild(String neoVersion)
    • isPRBuild

      public static boolean isPRBuild()