Deprecated API
Contents
-
Terminally Deprecated ElementsElementDescriptionuse the new
ScreenEvent.Render.BackgroundeventUsethe player versioninsteadUsethe hand sensitive versionas this version provides wrong hand informationUsethe hand sensitive versionas this version provides wrong hand informationUsethe context-aware versioninstead
-
Deprecated Interfaces
-
Deprecated ClassesClassDescriptionForge: Use
DatapackBuiltinEntriesProviderinsteaduse the newScreenEvent.Render.Backgroundevent
-
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 theacceptable villager distancesdata map insteadNeo: use thedata mapinsteadNeo: useLivingEntity.PLAYER_NOT_WEARING_DISGUISE_ITEM_FOR_TARGETwith target info insteadNeoforge: useIPlayerExtension.mayFly()to read andNeoForgeMod.CREATIVE_FLIGHTAttribute to modifyNeo: use thedata mapinsteadForge: 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.BlockNeo: UseIAbstractWidgetExtension.onClick(double, double, int)instead.Neo: UseBakedGlyph.renderType(Font.DisplayMode, boolean)insteaduseRegisterMenuScreensEventinsteadRegister viaRegisterParticleProvidersEventRegister viaRegisterParticleProvidersEventRegister viaRegisterParticleProvidersEventNeo: use overload that accepts BlockStateNeo: useUnbakedModelParser.parse(Reader)insteadNeo: UseBlockModelPartExtension.ambientOcclusion()instead.Neo: Use invalid input: '{@link net.minecraft.client.renderer.block.model.BlockModelPart#' getRenderType(BlockState)}.Neo: UsegetMovingBlockRenderType(ChunkSectionLayer)} with the result of invalid input: '{@' link net.minecraft.client.renderer.block.model.BlockModelPart# getRenderType(BlockState)}.invalid @link
{@link net.neoforged.neoforge.client.RenderTypeHelper#Neo: SeeBlockModelWrapper.renderType.Neo: UsegetEntityRenderType(ChunkSectionLayer)} with the result of invalid input: '{@link net.minecraft.client.renderer.block.model.BlockModelPart#' getRenderType(BlockState)}.invalid @link
{@link net.neoforged.neoforge.client.RenderTypeHelper#Set your render type in your block model's JSON (e.g."render_type": "cutout") or overrideBlockModelPartExtension.getRenderType(BlockState)Forge: For internal use only. Use the Register events when registering values.UseBundlerInfo.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} insteadNeo: usethe source-aware variantUseServerCommonPacketListenerImpl.createCookie(ClientInformation, net.neoforged.neoforge.network.connection.ConnectionType)instead, keeping the connection type information available.Neo: Use.invalid reference
net.neoforged.neoforge.client.event.AddClientReloadListenerEventForge: Userider sensitive versionNeo: useLivingEntity.travelInFluid(Vec3, FluidState)insteadNeo:Player.getDestroySpeed(BlockState, BlockPos)insteadNeo: Modders should useRegisterSpawnPlacementsEventinstead.Neo: useFeatureFlagRegistry.Builder.create(ResourceLocation, boolean)insteadForge: 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: do not use, usethe eventinsteadnet.minecraft.world.item.ItemStack.addAttributeTooltips(Consumer<Component>, TooltipDisplay, Player) Neo: UseaddAttributeTooltips}invalid @link
{@link net.neoforged.neoforge.common.util.AttributeUtil#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()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 propertyNeo: use overload with level context insteadUse IItemHandler capability instead. To preserve Container-specific interactions, useHopperBlockEntity.getContainerOrHandlerAt(net.minecraft.world.level.Level, net.minecraft.core.BlockPos, net.minecraft.core.Direction)and handle both cases.Neo: UseIBlockStateExtension.getLightEmission(BlockGetter, BlockPos)insteadNeo: UseIBlockStateExtension.ignitedByLava(BlockGetter, BlockPos, Direction)insteadNeo: use invalid input: '{@link net.neoforged.neoforge.common.extensions.IBlockStateExtension#' onCaughtFire(Level,BlockPos,net.minecraft.core.Direction, LivingEntity)} insteadNeo: use invalid input: '{@link net.neoforged.neoforge.common.extensions.IBlockStateExtension#' onCaughtFire(Level,BlockPos,net.minecraft.core.Direction, LivingEntity)} insteadnet.minecraft.world.level.levelgen.synth.ImprovedNoise.noise(double, double, double, double, double) Neo: use overload with level context insteadForge: UseFlowingFluid.canConvertToSource(FluidState, ServerLevel, BlockPos)instead.Forge: useLavaFluid.isFlammable(LevelReader,BlockPos, Direction)insteadnet.minecraft.world.level.storage.loot.LootTable.getRandomItemsRaw(LootContext, Consumer<ItemStack>) Usethe player versioninsteadUsethe hand sensitive versionas this version provides wrong hand informationVanilla 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 ConstructorsConstructorDescriptionUse
CommonListenerCookie(GameProfile, WorldSessionTelemetryManager, RegistryAccess.Frozen, FeatureFlagSet, String, ServerData, Screen, Map, ChatComponent.State, Map, ServerLinks, net.neoforged.neoforge.network.connection.ConnectionType)instead,to indicate whether the connection is modded.Neo: useRebuildTask(RenderSectionRegion, boolean, java.util.List)insteadForge: Use the mod id variantForge: 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: 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)insteadNeo: useFeatureFlag(FeatureFlagUniverse, int, int, boolean)insteadNeo: use constructor with additional data insteadNeo: use the constructorto support conditionsinvalid reference
with a default value and id setterUsethe hand sensitive versionas this version provides wrong hand informationUsethe context-aware versioninstead