Porting from 26.1 to 26.2
This page is a guide for modders who want to port their mod from Architectury API 20 to 21. It covers the breaking changes and new features introduced in Architectury 21 for Minecraft 26.2.
Changes to NeoForge package names
To keep compatibility, the NeoForge specific code had the same structure and the same package names as the forge specific code.
With the removal of forge support, the NeoForge specific code is now the only code, and the package names have been changed to reflect that.
You'll need to change your imports.
For example: dev.architectury.core.block.forge -> dev.architectury.core.block.neoforge.
Additions
RegistrarasVanillaRegistry()to access the underlyingnet.minecraft.core.Registry<T>.
EntityDataSerializerRegistry- You can now register
EntityDataSerializers withEntityDataSerializerRegistry.register(Identifier, EntityDataSerializer<T>)in the common package of your mod.
- You can now register
Event<T>register(EventPriority, T)to register an event listener at a given priority. Listeners with a higher priority are invoked first. Listeners sharing the same priority keep their registration order. The existingregister(T)now defaults toEventPriority.NORMAL.
EventPriority- New enum (
HIGHEST,HIGH,NORMAL,LOW,LOWEST) used to order event listeners.
- New enum (
EventResultfromMinecraft(InteractionResult)to create anEventResultfrom a vanillaInteractionResult.
CompoundEventResultasMinecraft()to get the vanillaInteractionResultversion ofEventResult.
Deprecations
EventFactorycreateInteractionResult(...)- Use
createEventResult(...)withEventResultinstead.- An
EventResultcan now represent any vanillaInteractionResultviaEventResult.fromMinecraft(InteractionResult)andEventResult#asMinecraft().
- An
- Will be removed in a future version.
- Use
Breaking Changes
ArchitecturyFluidAttributesgetSourceTexture(FluidStack)->getSourceTexture(FluidState)getFlowingTexture(FluidStack)->getFlowingTexture(FluidState)getColor(FluidStack)->getColor(FluidState)
RegistrySupplier<T>no longer extendsHolder<T>- Use
asHolder()to get aHolder<T>version of theRegistrySupplier<T>instance instead.
- Use
DeferredRegister<T>getHolder()->asHolder()
BlockEvent.BreakbreakBlock(Level, BlockPos, BlockState, ServerPlayer, IntValue)->breakBlock(Level, BlockPos, BlockState, ServerPlayer)- The
xpparameter was alwaysnullon both NeoForge and Fabric (neither platform's break event exposes it) and has been removed.
- The
- A few interaction events now return
EventResultinstead of vanillaInteractionResult.InteractionEventLeftClickBlock#clickRightClickBlock#clickRightClickItem#clickFarmlandTrample#trample
PlayerEventFillBucket#fill
- Use
EventResult#asMinecraft()to get the vanillaInteractionResultversion of theEventResultreturned by these events.
Removal
PlatformisForgeLike()- Use
isNeoForge()
- Use
FluidStackHooksgetLuminosity(Fluid, Level, BlockPos)- Use the vanilla
fluid.getFluidType().getLightLevel()instead.
- Use the vanilla
MenuRegistrySimpleMenuTypeFactoryof(SimpleMenuTypeFactory<T>)- Use the menu constructor directly instead.
ArchitecturyFluidAttributesgetSourceTexture(FluidStack, BlockAndLightGetter, BlockPos)- Use and override
getSourceTexture(FluidState, BlockAndLightGetter, BlockPos)instead.
- Use and override
getFlowingTexture(FluidStack, BlockAndLightGetter, BlockPos)- Use and override
getFlowingTexture(FluidState, BlockAndLightGetter, BlockPos)instead.
- Use and override
getColor(FluidStack, BlockAndLightGetter, BlockPos)- Use and override
getColor(FluidState, BlockAndLightGetter, BlockPos)instead.
- Use and override
RegistrySupplierImplNetworkAggregatorregisterReceiver(NetworkManager.Side, Identifier, List<PacketTransformer>, NetworkManager.NetworkReceiver<RegistryFriendlyByteBuf>)collectPackets(PacketSink, NetworkManager.Side, Identifier, RegistryFriendlyByteBuf)
NetworkManagertoPacket(Side, Identifier, RegistryFriendlyByteBuf)toPackets(Side, Identifier, RegistryFriendlyByteBuf)collectPackets(PacketSink, NetworkManager.Side, Identifier, RegistryFriendlyByteBuf)sendToPlayer(ServerPlayer, Identifier, RegistryFriendlyByteBuf)sendToPlayers(Iterable<ServerPlayer>, Identifier, RegistryFriendlyByteBuf)sendToServer(Identifier, RegistryFriendlyByteBuf)serverToClient()- Use
s2c()instead.
- Use
clientToServer()- Use
c2s()instead.
- Use