Migration Guide
This migration guide only covers breaking changes to existing code made to the Unified API between Minecraft versions. You'll want to check out the changelog for a full list of what's actually changed in the API.
26.1 to 26.2
This update has minimal overall API changes, however it comes with a major internal restructuring, which will require the re-importing of all classes. This change was made in order to split all code into api. and impl., so that internal-use code is clearly separated from developer-focused code (api. code will not receive breaking changes within the same Minecraft release).
Platform
- renamed
UnifiedPlatformtoUnifiedInstance - privatised
.get()- this was marked as internal back on 26.1, and you can use allUnifiedInstancemethods directly instead
- privatised
- renamed
getLoadertogetModLoader
- renamed
- renamed
LoaderTypetoModLoader
Registries
UnifiedRegistries- all deprecated
registerHoldermethods were removed in favour of the identicalregisterForHolder
- all deprecated
UnifiedRegistries.Blocks- removed deprecated registry methods that required a non-supplied
BlockEntityType
- removed deprecated registry methods that required a non-supplied
- you can replace these with new methods that are otherwise identical, but require
Supplier<BlockEntityType
- you can replace these with new methods that are otherwise identical, but require
- removed deprecated methods that allowed separate item property registrations
- you should either use
registerWithoutItemwith a separately registered item, or useUnifiedHelpers.DATA_COMPONENTSto replace usages of these
- you should either use
UnifiedRegistries.BlockEntityTypes- the deprecated register method which demanded the use of
Blockhas been removed in favour of itsBlockLikeequivalent
- the deprecated register method which demanded the use of
Supplied,SuppliedItemandSuppliedBlock- if you were using old registration methods, you might've been using
Supplier- switch to usingSuppliedfor additional features
- if you were using old registration methods, you might've been using
SuppliedItemandSuppliedBlockextendResourceKeyrather than the old (deprecated) ones within 26.1 extendingHolder
- if you were still using the old
SuppliedItemandSuppliedBlockand need access to aHolder, use the.holder()method
- if you were still using the old
Helpers
- replaced
UnifiedHelpers.PACKSwithUnifiedHelpers.DATA_PACKSandUnifiedClientHelpers.RESOURCE_PACKS - this split was made for clarity, and to remove unnecessary enums
- both new helpers contain
addOptionalandaddRequired, which you can use instead ofaddwithPackType
- both new helpers contain
- removed
PackType - not used anymore due to the replacement of
UnifiedHelpers.PACKS
- not used anymore due to the replacement of
- renamed
UnifiedClientHelpers.LEGACY_BABY_ARMORtoUnifiedClientHelpers.SIMPLE_BABY_ARMOR - replaced
add(ResourceKey<EquipmentAsset> asset, boolean resize, int cutoff)withadd(ResourceKey<EquipmentAsset> asset, int cutoff)
- replaced
- replaced
add(ResourceKey<EquipmentAsset> asset, boolean resize)withaddWithoutDownscale
- replaced
UnifiedHelpers- deprecated methods which demanded the use of a
Blockhave been removed in favour of theirBlockLikeequivalents
- deprecated methods which demanded the use of a
- moved
HelpersImpl.BiomeModifications.ContexttoBiomeModificationContext - now part of
api.
- now part of
Events
- renamed
EventTypetoEventTiming - renamed
UnifiedClientEvents.GuistoUnifiedClientEvents.Hud - matches vanilla renames in 26.2
UnifiedEvents- deprecated
modifyFilteredmethods and replaced with the identicalmodifyWithFilter
- deprecated
UnifiedEvents.LootTables- removed the deprecated
editPoolmethod
- removed the deprecated
- the newer
editPoolmethod introduced a while back uses aLootEntrywhich supports replacement, insertion and removal, rather than just replacement and insertion
- the newer
UnifiedHelpers.BLOCK_CONVERSIONS- removed
addWeathering(WeatheringCopperBlocks set)
- removed
- vanilla removed
WeatheringCopperBlocksand anotheraddWeatheringmethod still exists, so this was removed outright
- vanilla removed
- moved
EventsImpl.LootTables.LootTabletoLootTableContext - now part of
api.
- now part of
Utilities
- renamed
CreativeModeTabstoCreativeModeTabIds - this was made for consistency with new vanilla id classes, and to distinguish it from the vanilla
CreativeModeTabsclass
- this was made for consistency with new vanilla id classes, and to distinguish it from the vanilla
1.21.11 to 26.1
Registries
UnifiedRegistries.DeferredRegistry- allows you to register content to any vanilla or modded registry
UnifiedRegistries.Items- whilst optional, you should use
SuppliedItemrather thanSupplier<Item>
- whilst optional, you should use
UnifiedRegistries.Blocks- whilst optional, you should use
SuppliedBlockrather thanSupplier<Block>
- whilst optional, you should use
- removed
UnifiedRegistries.MobEffects - this was made redundant by
UnifiedRegistries.DeferredRegistry
- this was made redundant by
- removed
UnifiedRegistries.ParticleTypes - this was made redundant by
UnifiedRegistries.DeferredRegistry
- this was made redundant by
Helpers
- replaced
UnifiedHelpers.PLATFORMwithUnifiedPlatform.get() - replaced
getEnvironmentwithisClientSideandisServerSide
- replaced
- renamed
PlatformType getPlatformtoLoaderType getLoader
- renamed
- removed
UnifiedHelpers.LOOT_TABLES - this has been replaced by the more powerful
UnifiedEvents.LootTables
- this has been replaced by the more powerful
- removed
UnifiedHelpers.FURNACE_FUELS - this has been replaced by the more powerful
UnifiedHelpers.DATA_COMPONENTSandUnifiedDataComponents.FURNACE_FUEL
- this has been replaced by the more powerful
- the equivalent of
FURNACE_FUELS.addwould beDATA_COMPONENTS.addFurnaceFuel
- the equivalent of
- removed
UnifiedHelpers.STRIPPABLES - this has been replaced by the more powerful
UnifiedHelpers.BLOCK_CONVERSIONS
- this has been replaced by the more powerful
- the equivalent of
STRIPPABLES.addwould beBLOCK_CONVERSIONS.addStrippable
- the equivalent of
UnifiedHelpers.CREATIVE_ENTRIES- all methods which previously accepted an ItemStack now require an ItemStackTemplate
- renamed
addtoinsert
- renamed
- renamed
addAftertoinsertAfter
- renamed
- renamed
addBeforetoinsertBefore
- renamed
UnifiedHelpers.NETWORKING- renamed
registerPlayC2StoregisterPlayToServer
- renamed
- renamed
registerPlayS2CtoregisterPlayToClient
- renamed
- renamed
registerConfigC2StoregisterConfigToServer
- renamed
- renamed
registerConfigS2CtoregisterConfigToClient
- renamed
- removed
UnifiedClientHelpers.BLOCK_LAYERS, as 26.1 vanilla handles this behavior automatically now - added
UnifiedClientHelpers.LEGACY_BABY_ARMOR - the
addmethod can be used to add EquipmentAsset resource keys to a list which reverts to pre-26.1 baby armor rendering, providing a fallback for armor sets lacking dedicated baby textures
- the
Events
- renamed
UnifiedEvents.ItemComponentstoUnifiedEvents.DefaultDataComponents modifyno longer provides an Item predicate
- if you'd like to continue using the predicate, instead use
modifyFiltered
- if you'd like to continue using the predicate, instead use
- both methods provide a
TriConsumerwith aHolderLookup.Provider
- both methods provide a
- renamed
UnifiedClientEvents.TickstoUnifiedClientEvents.Instance - replaced
atStartandatEndwithonTick, which acceptsEventType
- replaced
UnifiedEvents.Players.onRespawn- now provides a BiConsumer with
oldPlayerandnewPlayer
- now provides a BiConsumer with
- previously, only the new player was provided, so usages of this event must be adjusted
Utilities
- renamed
UnifiedItemComponentstoUnifiedDataComponents - renamed
PackInfotoPackType - renamed
PlatformInfotoLoaderType