Deprecated API
Contents
-
Terminally Deprecated ElementsElementDescriptionNeo: Use
CrashReportCategory.setStackTrace(StackTraceElement[])instead.Neo: The additional mod ID parameter is unused; use the one-parameter constructor instead.Neo: Avoid using this method to get the mod ID, as this method will be removed in 1.21.2.UseRegisterClientExtensionsEventinsteadNeo: To be removed without replacement since registry replacement is not a feature anymore.UseRegisterClientExtensionsEventinsteadNeo: To be removed without replacement since registry replacement is not a feature anymore.UseRegisterClientExtensionsEventinsteadPlanned on being removed in 1.21.1 due to extreme maintenance burden to make this event fire consistently for most screens.Use extension methods inIGuiGraphicsExtensioninsteadUseKeyModifier.getActiveModifiers()instead.Usethe player versioninsteadUseDataMapProvider.gather(HolderLookup.Provider)instead.Use a data component/attachment to store info, orEntity.load(CompoundTag)as a replacement.Use a data component/attachment to store info. (Entity.setData(AttachmentType, Object))To be replaced with hand sensitive version in 21.2To be replaced with hand sensitive version in 21.2UseTagBuilder.remove(TagEntry)instead.UseITagBuilderExtension.removeElement(ResourceLocation)instead.UseITagBuilderExtension.removeElement(ResourceLocation)instead.This method has been removed in 1.21.5This type often causes more data corruption than is worth.Usethe hand sensitive versionas this version provides wrong hand informationUsethe hand sensitive versionas this version provides wrong hand informationUsethe context-aware versioninsteadUseWandererTradesEvent(List, List, RegistryAccess)insteadUseFluidStack.getHoverName()instead.PreferFluidStack.getHoverName().UseRegisterClientExtensionsEventinsteadScheduled for removal in 1.21.2; useDeferredRegister.createDataComponents(ResourceKey, String)withRegistries.DATA_COMPONENT_TYPEinsteadScheduled for removal in 1.21.2; useDataComponents(ResourceKey, String)This event is no longer fired, useDeferredRegister.addAlias(ResourceLocation, ResourceLocation)orIRegistryExtension.addAlias(ResourceLocation, ResourceLocation)instead
-
Deprecated Interfaces
-
Deprecated ClassesClassDescriptionNeoForge: Use
AdvancementProviderinstead, provides ease of access for theExistingFileHelperin the generatorForge: UseDatapackBuiltinEntriesProviderinsteadPlanned on being removed in 1.21.1 due to extreme maintenance burden to make this event fire consistently for most screens.Use extension methods inIGuiGraphicsExtensioninsteadThis type often causes more data corruption than is worth.This event is no longer fired, useDeferredRegister.addAlias(ResourceLocation, ResourceLocation)orIRegistryExtension.addAlias(ResourceLocation, ResourceLocation)instead
-
Deprecated Enum Classes
-
Deprecated Record ClassesRecord ClassDescription
-
Deprecated FieldsFieldDescriptionForge: Use
PresetEditorManager.get(ResourceKey)instead.UseSharedConstants.getCurrentVersion(),}, and com.mojang.bridge.game.PackType#DATA instead.invalid @link
{@link com.mojang.bridge.game.GameVersion#com.mojang.bridge.game.GameVersion#getPackVersion(com.mojang.bridge.game.PackType)UseSharedConstants.getProtocolVersion()instead.UseSharedConstants.getCurrentVersion(),}, and com.mojang.bridge.game.PackType#RESOURCE instead.invalid @link
{@link com.mojang.bridge.game.GameVersion#com.mojang.bridge.game.GameVersion#getPackVersion(com.mojang.bridge.game.PackType)UseSharedConstants.getCurrentVersion()andinstead.invalid reference
com.mojang.bridge.game.GameVersion#isStable()UseSharedConstants.getProtocolVersion()instead.UseSharedConstants.getCurrentVersion()andinstead.invalid reference
com.mojang.bridge.game.GameVersion#getName()UseSharedConstants.getCurrentVersion()andinstead.invalid reference
com.mojang.bridge.game.GameVersion#getWorldVersion()Neo: use thedata mapinsteadNeo: use thedata mapinsteadNeoforge: useIPlayerExtension.mayFly()to read andNeoForgeMod.CREATIVE_FLIGHTAttribute to modifyNeo: Will beBlocks.AIRfor modded boat types, useBoat.Type.planksSupplierinsteadForge: This map is patched out of vanilla code. Listen toBlockEvent.BlockToolModificationEventor overrideIBlockExtension.getToolModifiedState(BlockState, UseOnContext, net.neoforged.neoforge.common.ItemAbility, boolean).Use theinverse mapgenerated from the data map, this field will be ignored in a future versionNeo: Use thedata map, this field will be ignored in a future versionNeo: Use thecompostabledata map insteadNeo: Usethe data map, this field will be ignored in a future versionNeo: Use theinverse mapgenerated from the data map, this field will be ignored in a future versionNeo: use thedata mapinstead.
-
Deprecated MethodsMethodDescriptionNeo: call
Camera.setRotation(float, float, float)insteadRegister viaRegisterColorHandlersEvent.BlockRegister viaRegisterColorHandlersEvent.ItemNeo: UseIAbstractWidgetExtension.onClick(double, double, int)instead.Forge: Use gradient overload insteaduseRegisterMenuScreensEventinsteadRegister viaRegisterParticleProvidersEventRegister viaRegisterParticleProvidersEventRegister viaRegisterParticleProvidersEventNeo: use overload that accepts BlockStateForge: UsegetRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)}.invalid @link
{@link net.minecraft.client.resources.model.BakedModel#Forge: UsegetMovingBlockRenderType(RenderType)} while iterating through invalid input: '{@' link net.minecraft.client.resources.model.BakedModel#getRenderTypes (BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)}.invalid @link
{@link net.neoforged.neoforge.client.RenderTypeHelper#Forge: UsegetRenderPasses(ItemStack, boolean)} andinvalid @link
{@link net.minecraft.client.resources.model.BakedModel#IBakedModelExtension.getRenderTypes(ItemStack, boolean).Forge: UsegetEntityRenderType(RenderType, boolean)} while iterating through {invalid @link
{@link net.neoforged.neoforge.client.RenderTypeHelper#Set your render type in your block model's JSON (eg."render_type": "cutout") or overrideIBakedModelExtension.getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)Set your render type in your block model's JSON (eg."render_type": "cutout") or overrideIBakedModelExtension.getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)Set your render type in your block model's JSON (eg."render_type": "cutout") or overrideIBakedModelExtension.getRenderTypes(BlockState, net.minecraft.util.RandomSource, net.neoforged.neoforge.client.model.data.ModelData)Forge: Use variant with RenderTypeGroupForge: For internal use only. Use the Register events when registering values.Neo: UseCrashReportCategory.setStackTrace(StackTraceElement[])instead.Neo: Avoid using this method to get the mod ID, as this method will be removed in 1.21.2.Forge: UseRegisterGameTestsEventto register game testsForge: UseRegisterGameTestsEventto register game testsForge: UseRegisterGameTestsEventto register game testsUseBundlerInfo.unbundlePacket(Packet, Consumer, io.netty.channel.ChannelHandlerContext)instead, as it supports packet filtering and is more efficient.Neo: use overload with ConnectionType contextNeoForge: Use invalid input: '{@link net.neoforged.neoforge.registries.NeoForgeRegistries#' ENTITY_DATA_SERIALIZERS} insteadUseServerCommonPacketListenerImpl.createCookie(ClientInformation, net.neoforged.neoforge.network.connection.ConnectionType)instead, keeping the connection type information available.UseRegisterClientExtensionsEventinsteadForge: Userider sensitive versionNeo: Useinstead.invalid reference
net.neoforged.neoforge.common.IShearable#isShearable(net.minecraft.world.item.ItemStack, net.minecraft.world.level.Level, net.minecraft.core.BlockPos)Neo: Useinstead.invalid reference
net.neoforged.neoforge.common.IShearable#onSheared(net.minecraft.world.entity.player.Player, net.minecraft.world.item.ItemStack, net.minecraft.world.level.Level, net.minecraft.core.BlockPos, int)Neo: Modders should useRegisterSpawnPlacementsEventinstead.Neo: useFeatureFlagRegistry.Builder.create(ResourceLocation, boolean)insteadNeo: To be removed without replacement since registry replacement is not a feature anymore.Forge: useCreativeModeTab.builder()Neo: UseIItemStackExtension.isPrimaryItemFor(Holder)This method does not respectIItemStackExtension.supportsEnchantment(Holder)since theHolderis not available, which makes the result of calling it invalid.Neo: UseEnchantmentHelper.getTagEnchantmentLevel(Holder, ItemStack)for NBT enchantments, orIItemStackExtension.getEnchantmentLevel(Holder)for gameplay.Neo: callIItemStackExtension.canFitInsideContainerItems()instead, prefer overridingIItemExtension.canFitInsideContainerItems(ItemStack)Neo: Use ItemStack sensitive version.UseRegisterClientExtensionsEventinsteadNeo: do not use, usethe eventinsteadNeo: UseaddAttributeTooltips}invalid @link
{@link net.neoforged.neoforge.client.util.TooltipUtil#Neo: UseItemStack.getTagEnchantments()for NBT enchantments, orIItemStackExtension.getAllEnchantments(net.minecraft.core.HolderLookup.RegistryLookup<net.minecraft.world.item.enchantment.Enchantment>)for gameplay.Forge: Use invalid input: '{@linkplain net.neoforged.neoforge.common.extensions.IItemStackExtension#' onDestroyed(ItemEntity, net.minecraft.world.damagesource.DamageSource) damage source sensitive version}Use ItemStack sensitive versionProjectileWeaponItem.getAllSupportedProjectiles(ItemStack)Use ItemStack sensitive versionProjectileWeaponItem.getSupportedHeldProjectiles(ItemStack)NeoForge: UseRarity.getStyleModifier()Neo: To be removed without replacement since registry replacement is not a feature anymore.Forge: UseBaseRailBlock.getRailDirection(BlockState, BlockGetter, BlockPos, net.minecraft.world.entity.vehicle.AbstractMinecart)for enhanced ability If you do change this property be aware that other functions in this/subclasses may break as they can make assumptions about this propertyUseRegisterClientExtensionsEventinsteadcall viawhenever possible. Implementing/overriding is fine.invalid reference
IBlockState#getRenderType()call viawhenever possible. Implementing/overriding is fine.invalid reference
IBlockState#getRenderType()Neo: get burn times by callingIItemStackExtension.getBurnTime(RecipeType)Forge: UseIBlockStateExtension.getLightEmission(BlockGetter, BlockPos)insteadNeo: UseIBlockStateExtension.ignitedByLava(BlockGetter, BlockPos, Direction)insteadnet.minecraft.world.level.levelgen.synth.ImprovedNoise.noise(double, double, double, double, double) Forge: UseFlowingFluid.canConvertToSource(FluidState, Level, BlockPos)instead.Forge: useLavaFluid.isFlammable(LevelReader,BlockPos, Direction)insteadnet.minecraft.world.level.storage.loot.LootTable.getRandomItemsRaw(LootContext, Consumer<ItemStack>) UseKeyModifier.getActiveModifiers()instead.Usethe player versioninsteadUseDataMapProvider.gather(HolderLookup.Provider)instead.Use a data component/attachment to store info, orEntity.load(CompoundTag)as a replacement.Use a data component/attachment to store info. (Entity.setData(AttachmentType, Object))To be replaced with hand sensitive version in 21.2To be replaced with hand sensitive version in 21.2UseTagBuilder.remove(TagEntry)instead.UseITagBuilderExtension.removeElement(ResourceLocation)instead.UseITagBuilderExtension.removeElement(ResourceLocation)instead.This method has been removed in 1.21.5Usethe hand sensitive versionas this version provides wrong hand informationUseFluidStack.getHoverName()instead.PreferFluidStack.getHoverName().UseRegisterClientExtensionsEventinsteadScheduled for removal in 1.21.2; useDeferredRegister.createDataComponents(ResourceKey, String)withRegistries.DATA_COMPONENT_TYPEinsteadVanilla has deprecated intrusive holders and is in the process of moving away from them, you should not use this unless you have no better option.
-
Deprecated ConstructorsConstructorDescriptionForge: Use variant with RenderTypeGroupForge: Use the mod id variantForge: Use the mod id variantnet.minecraft.data.tags.CatVariantTagsProvider
(PackOutput, CompletableFuture<HolderLookup.Provider>) Forge: Use the mod id variantnet.minecraft.data.tags.DamageTypeTagsProvider(PackOutput, CompletableFuture<HolderLookup.Provider>) Forge: Use the mod id variantForge: Use the mod id variantnet.minecraft.data.tags.EntityTypeTagsProvider(PackOutput, CompletableFuture<HolderLookup.Provider>) Forge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantNeo: Use the mod id variantnet.minecraft.data.tags.InstrumentTagsProvider(PackOutput, CompletableFuture<HolderLookup.Provider>) Forge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantForge: Use the mod id variantNeo: The additional mod ID parameter is unused; use the one-parameter constructor instead.Forge: Use the mod id variantNeo: use overload with ConnectionType contextUseCommonListenerCookie(GameProfile, int, ClientInformation, boolean, net.neoforged.neoforge.network.connection.ConnectionType)instead, to indicate whether the connection is modded.Neo: useMetadata(Component,PackCompatibility,FeatureFlagSet,List,boolean)insteadForge: UseTagFile(List, boolean, List)which has support for remove entries.Neo: useFeatureFlag(FeatureFlagUniverse, int, int, boolean)insteadForge: UseDeferredSpawnEggIteminstead for suppliersNeo: use the constructorto support conditionsinvalid reference
with a default value and id setterUsethe hand sensitive versionas this version provides wrong hand informationUsethe context-aware versioninsteadNeo: use the constructorwith a lookup providerUseWandererTradesEvent(List, List, RegistryAccess)insteadScheduled for removal in 1.21.2; useDataComponents(ResourceKey, String)