Package net.neoforged.neoforge.common
Class NeoForgeMod
java.lang.Object
net.neoforged.neoforge.common.NeoForgeMod
-
Field Summary
Modifier and TypeFieldDescriptionstatic final DeferredHolder
<com.mojang.serialization.MapCodec<? extends BiomeModifier>, com.mojang.serialization.MapCodec<BiomeModifiers.AddCarversBiomeModifier>> Stock biome modifier for adding carvers to biomes.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends BiomeModifier>, com.mojang.serialization.MapCodec<BiomeModifiers.AddFeaturesBiomeModifier>> Stock biome modifier for adding features to biomes.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends BiomeModifier>, com.mojang.serialization.MapCodec<BiomeModifiers.AddSpawnCostsBiomeModifier>> Stock biome modifier for adding mob spawn costs to biomes.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends BiomeModifier>, com.mojang.serialization.MapCodec<BiomeModifiers.AddSpawnsBiomeModifier>> Stock biome modifier for adding mob spawns to biomes.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends StructureModifier>, com.mojang.serialization.MapCodec<StructureModifiers.AddSpawnsStructureModifier>> Stock structure modifier for adding mob spawns to structures.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends IGlobalLootModifier>, com.mojang.serialization.MapCodec<AddTableLootModifier>> Stock loot modifier type that adds loot from a subtable to the final loot.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends ICondition>, com.mojang.serialization.MapCodec<AndCondition>> static final Holder
<HolderSetType> Stock holder set type that represents an intersection of other holdersets.static final Holder
<HolderSetType> Stock holder set type that represents any/all values in a registry.private static final DeferredRegister
<Attribute> private static final DeferredRegister
<com.mojang.serialization.MapCodec<? extends BiomeModifier>> static final DeferredHolder
<IngredientType<?>, IngredientType<BlockTagIngredient>> static final DeferredHolder
<SoundEvent, SoundEvent> static final DeferredHolder
<SoundEvent, SoundEvent> static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends StructureModifier>, com.mojang.serialization.MapCodec<StructureModifiers.ClearSpawnsStructureModifier>> Stock structure modifier for removing spawn override lists from structures.private static final DeferredRegister
<ArgumentTypeInfo<?, ?>> static final DeferredHolder
<FluidIngredientType<?>, FluidIngredientType<CompoundFluidIngredient>> static final DeferredHolder
<IngredientType<?>, IngredientType<CompoundIngredient>> private static final DeferredRegister
<com.mojang.serialization.MapCodec<? extends ICondition>> Grants the player the ability to use creative flight when not in creative mode.static final DeferredHolder
<FluidIngredientType<?>, FluidIngredientType<DataComponentFluidIngredient>> static final DeferredHolder
<IngredientType<?>, IngredientType<DataComponentIngredient>> static final DeferredHolder
<FluidIngredientType<?>, FluidIngredientType<DifferenceFluidIngredient>> static final DeferredHolder
<IngredientType<?>, IngredientType<DifferenceIngredient>> static final DeferredHolder
<FluidIngredientType<?>, FluidIngredientType<EmptyFluidIngredient>> private static boolean
private static boolean
private static final DeferredRegister
<com.mojang.serialization.MapCodec<? extends EntitySubPredicate>> private static final Holder
<ArgumentTypeInfo<?, ?>> static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends ICondition>, com.mojang.serialization.MapCodec<FalseCondition>> static final DeferredHolder
<Fluid, Fluid> private static final DeferredRegister
<FluidIngredientType<?>> private static final DeferredRegister
<com.mojang.serialization.MapCodec<? extends IGlobalLootModifier>> private static final DeferredRegister
<HolderSetType> private static final DeferredRegister
<IngredientType<?>> static final DeferredHolder
<FluidIngredientType<?>, FluidIngredientType<IntersectionFluidIngredient>> static final DeferredHolder
<IngredientType<?>, IngredientType<IntersectionIngredient>> private static boolean
static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends ICondition>, com.mojang.serialization.MapCodec<ItemExistsCondition>> private static final DeferredRegister
<ItemSubPredicate.Type<?>> private static final org.apache.logging.log4j.Logger
static final DeferredHolder
<Fluid, Fluid> static final DeferredHolder
<FluidType, FluidType> static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends ICondition>, com.mojang.serialization.MapCodec<ModLoadedCondition>> private static final DeferredHolder
<ArgumentTypeInfo<?, ?>, SingletonArgumentInfo<ModIdArgument>> private static final org.apache.logging.log4j.Marker
static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends BiomeModifier>, com.mojang.serialization.MapCodec<NoneBiomeModifier>> Noop biome modifier.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends StructureModifier>, com.mojang.serialization.MapCodec<NoneStructureModifier>> Noop structure modifier.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends ICondition>, com.mojang.serialization.MapCodec<NotCondition>> static final Holder
<HolderSetType> Stock holder set type that represents all values in a registry except those in another given set.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends ICondition>, com.mojang.serialization.MapCodec<OrCondition>> static final Holder
<HolderSetType> Stock holder set type that represents a union of other holdersets.static final DeferredHolder
<ItemSubPredicate.Type<?>, ItemSubPredicate.Type<PiglinCurrencyItemPredicate>> static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends EntitySubPredicate>, com.mojang.serialization.MapCodec<PiglinNeutralArmorEntityPredicate>> static final ResourceKey
<DamageType> Used in place ofDamageSources.magic()
for damage dealt byMobEffects.POISON
.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends BiomeModifier>, com.mojang.serialization.MapCodec<BiomeModifiers.RemoveCarversBiomeModifier>> Stock biome modifier for removing carvers from biomes.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends BiomeModifier>, com.mojang.serialization.MapCodec<BiomeModifiers.RemoveFeaturesBiomeModifier>> Stock biome modifier for removing features from biomes.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends BiomeModifier>, com.mojang.serialization.MapCodec<BiomeModifiers.RemoveSpawnCostsBiomeModifier>> Stock biome modifier for removing mob spawn costs from biomes.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends BiomeModifier>, com.mojang.serialization.MapCodec<BiomeModifiers.RemoveSpawnsBiomeModifier>> Stock biome modifier for removing mob spawns from biomes.static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends StructureModifier>, com.mojang.serialization.MapCodec<StructureModifiers.RemoveSpawnsStructureModifier>> Stock structure modifier for removing mob spawns from structures.static final DeferredHolder
<FluidIngredientType<?>, FluidIngredientType<SingleFluidIngredient>> private static final DeferredRegister
<com.mojang.serialization.MapCodec<? extends StructureModifier>> static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends ICondition>, com.mojang.serialization.MapCodec<TagEmptyCondition>> static final DeferredHolder
<FluidIngredientType<?>, FluidIngredientType<TagFluidIngredient>> static final DeferredHolder
<ItemSubPredicate.Type<?>, ItemSubPredicate.Type<ToolActionItemPredicate>> static final DeferredHolder
<com.mojang.serialization.MapCodec<? extends ICondition>, com.mojang.serialization.MapCodec<TrueCondition>> static final PermissionNode
<Boolean> private static final DeferredRegister
<FluidType> static final String
-
Constructor Summary
ConstructorDescriptionNeoForgeMod
(net.neoforged.bus.api.IEventBus modEventBus, net.neoforged.api.distmarker.Dist dist, net.neoforged.fml.ModContainer container) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
Run this method during mod constructor to enable milk and add it to the Minecraft milk bucketstatic void
Run this method during mod constructor to enableFileUtil.RESERVED_WINDOWS_FILENAMES_NEOFORGE
regex being used for filepath validation.void
gatherData
(GatherDataEvent event) static boolean
static boolean
private static boolean
void
loadComplete
(net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent event) void
preInit
(net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent evt) void
registerFluids
(RegisterEvent event) void
registerLootData
(RegisterEvent event) void
void
void
-
Field Details
-
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
-
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
-
ENUM_COMMAND_ARGUMENT_TYPE
-
MODID_COMMAND_ARGUMENT_TYPE
private static final DeferredHolder<ArgumentTypeInfo<?,?>, MODID_COMMAND_ARGUMENT_TYPESingletonArgumentInfo<ModIdArgument>> -
SWIM_SPEED
-
NAMETAG_DISTANCE
-
CREATIVE_FLIGHT
Grants the player the ability to use creative flight when not in creative mode. Anything above zero allows flight.For this attribute, you should only use the following modifier values:
- A value of 1 with
invalid reference
net.minecraft.world.entity.ai.attributes.AttributeModifier.Operation#ADDITION
- A value of -1 with
invalid reference
net.minecraft.world.entity.ai.attributes.AttributeModifier.Operation#MULTIPLY_TOTAL
Additionally, it permits forcibly disabling the attribute through multiply total.
To determine if a player has flight access via game mode or attribute, use
IPlayerExtension.mayFly()
Game mode flight cannot be disabled via this attribute.
- A value of 1 with
-
ADD_TABLE_LOOT_MODIFIER_TYPE
public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends IGlobalLootModifier>,com.mojang.serialization.MapCodec<AddTableLootModifier>> ADD_TABLE_LOOT_MODIFIER_TYPEStock 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_TYPENoop 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_TYPEStock 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_TYPEStock 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_TYPEStock 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_TYPEStock 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_TYPEStock 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_TYPEStock 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_TYPEStock 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_TYPEStock 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_TYPENoop 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_TYPEStock 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_TYPEStock 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_TYPEStock structure modifier for removing spawn override lists from structures. -
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
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
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
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 }
-
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 -
FLUID_INGREDIENT_TYPES
-
SINGLE_FLUID_INGREDIENT_TYPE
public static final DeferredHolder<FluidIngredientType<?>,FluidIngredientType<SingleFluidIngredient>> SINGLE_FLUID_INGREDIENT_TYPE -
TAG_FLUID_INGREDIENT_TYPE
public static final DeferredHolder<FluidIngredientType<?>,FluidIngredientType<TagFluidIngredient>> TAG_FLUID_INGREDIENT_TYPE -
EMPTY_FLUID_INGREDIENT_TYPE
public static final DeferredHolder<FluidIngredientType<?>,FluidIngredientType<EmptyFluidIngredient>> EMPTY_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 -
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 -
FALSE_CONDITION
public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<FalseCondition>> FALSE_CONDITION -
ITEM_EXISTS_CONDITION
public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<ItemExistsCondition>> ITEM_EXISTS_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 -
TRUE_CONDITION
public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends ICondition>,com.mojang.serialization.MapCodec<TrueCondition>> TRUE_CONDITION -
ENTITY_PREDICATE_CODECS
private static final DeferredRegister<com.mojang.serialization.MapCodec<? extends EntitySubPredicate>> ENTITY_PREDICATE_CODECS -
PIGLIN_NEUTRAL_ARMOR_PREDICATE
public static final DeferredHolder<com.mojang.serialization.MapCodec<? extends EntitySubPredicate>,com.mojang.serialization.MapCodec<PiglinNeutralArmorEntityPredicate>> PIGLIN_NEUTRAL_ARMOR_PREDICATE -
ITEM_SUB_PREDICATES
-
TOOL_ACTION_PREDICATE
public static final DeferredHolder<ItemSubPredicate.Type<?>,ItemSubPredicate.Type<ToolActionItemPredicate>> TOOL_ACTION_PREDICATE -
PIGLIN_CURRENCY_PREDICATE
public static final DeferredHolder<ItemSubPredicate.Type<?>,ItemSubPredicate.Type<PiglinCurrencyItemPredicate>> PIGLIN_CURRENCY_PREDICATE -
VANILLA_FLUID_TYPES
-
EMPTY_TYPE
-
WATER_TYPE
-
LAVA_TYPE
-
enableProperFilenameValidation
private static boolean enableProperFilenameValidation -
enableMilkFluid
private static boolean enableMilkFluid -
BUCKET_EMPTY_MILK
-
BUCKET_FILL_MILK
-
MILK_TYPE
-
MILK
-
FLOWING_MILK
-
POISON_DAMAGE
Used in place ofDamageSources.magic()
for damage dealt byMobEffects.POISON
.May also be used by mods providing poison-like effects.
-
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 -
enableProperFilenameValidation
public static void enableProperFilenameValidation()Run this method during mod constructor to enableFileUtil.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() -
preInit
public void preInit(net.neoforged.fml.event.lifecycle.FMLCommonSetupEvent evt) -
loadComplete
public void loadComplete(net.neoforged.fml.event.lifecycle.FMLLoadCompleteEvent event) -
serverStopping
-
gatherData
-
registerFluids
-
registerVanillaDisplayContexts
-
registerLootData
-
registerPermissionNodes
-
isPRBuild
-
isPRBuild
public static boolean isPRBuild()
-