Fabric for Minecraft 1.20 (2024)

Minecraft 1.20 - the Trails and Tales Update - releases on June 7th 2023, again with a number of changes that impact many mods.

As usual, we ask players to be patient, and give mod developers time to update to this new version.

Here is a list of all major modder-facing changes in this version. Note that all code references are using Yarn mappings; modders using alternative mappings may need to use different names.

Fabric changes

Developers should use Loom 1.2 (at the time of writing) to develop for Minecraft 1.20. Players should install the latest stable version of Fabric Loader (currently 0.14.19) to play 1.20.

Loom 1.2

Loom 1.2 is a small update focused on game library handling improvements and official Windows ARM native support. Loom 1.2 requires Gradle 8.1.

New Fabric API changes

Fabric API added many features since the last update blog post:

  • Data Generation: add codec data provider. (ErrorCraft)
  • Interaction Events: provide fake player API. (Technici4n)
  • Networking: add packet-based API similar to vanilla networking system. See the gist for migration tips. Note that the existing API is not deprecated in any way. (apple502j)
  • Renderer API: add material inspection and glint material property, remove texture indices. (PepperCode1, Technici4n)
  • Transfer API: add slotted storage and non-empty iterator. (Technici4n)
  • Other small additions to various APIs, such as Convention Tag and Object Builder

Breaking changes and deprecations

Aside from changes related to Minecraft code changes (which are discussed below), no breaking change to the API was introduced.

During one of the code refactors, one bug related to the Registry Sync was “accidentally” fixed. The bug previously allowed clients with Fabric API (but without content mods) to join a server with modded contents, despite the mod being missing on the client. The refactor was merged to both 1.19.4 and 1.20 snapshot branches; however, the bug was reintroduced to 1.19.4 only to prevent unexpected breakage. If you have previously relied on the bug, make sure to have users install the mods on the client.

A few rarely-used APIs within EventFactory were deprecated. They were intended to be used for profiling events; however, the standard Java profiler provides a better result.

  • invalidate method was terminally deprecated, to be removed in future versions.
  • isProfilingEnabled method was deprecated and now always returns false.
  • getHandlerName method was also deprecated.

Fabric Rendering API deprecations

Many methods of the renderer API had an int spriteIndex parameter that was always 0. It was removed, and the naming of some methods was improved in the process. The boolean disableAo material property was also replaced by a more flexible TriState for ambientOcclusion.

The old methods are now deprecated, here are a few examples of migrating away from them:

 MaterialFinder finder = ...;- materialFinder.blendMode(0, <blend mode>);+ materialFinder.blendMode(<blend mode>);- materialFinder.disableAo(0, true);+ materialFinder.ambientOcclusion(TriState.FALSE); QuadView quadView = ...;- quadView.spriteColor(0, -1, -1, -1, -1);+ quadView.color(-1, -1, -1, -1);

The full list of renames can be found in the pull request description.

The new methods do not have a default implementation in 1.20. This does not affect mods using the Renderer API, however third-party renderers such as Canvas or Indium must add support for them.

Minecraft changes

Minecraft 1.20 introduces some breaking changes to major developer-facing APIs.

Material (or the lack thereof)

Material was a class that indicated the type of blocks, such as plant or metal. This class no longer exists:

  • To specify the properties, such as the map color and whether the block is replaceable, use the block settings.One note on the new solid and notSolid block settings: These two methods override the default solid block check. If a block is not specified as solid or not solid explicitly, then the game checks whether the shape’s average side length is more than 0.73 OR whether the block is taller than 1 block. If either is true, the block is solid.
  • To get those values, use BlockState methods. (You may need to refactor your code if your method takes Block instead of BlockState.)
  • To check if a block is of a certain type, use block tags or instanceof.

Related changes:

  • BlockSetType now has canOpenByHand field, used by doors and trapdoors.
  • Block#canMobSpawnInside now takes a BlockState. Previously it took no arguments.
  • BlockState#blocksMovement, which returns true for all solid blocks except cobwebs and bamboo shoots, was added.
  • Block.Settings#of method was renamed to create. Fabric API’s FabricBlockSettings#of was renamed as well, and the old method was deprecated.
  • Fabric API: FabricMaterialBuilder was removed.
- new Block(AbstractBlock.Settings.of(Material.PLANT, MapColor.GREEN))+ new Block(AbstractBlock.Settings.create().mapColor(MapColor.GREEN).pistonBehavior(PistonBehavior.DESTROY))

World changes

One of the biggest, yet subtle changes in this version is that Entity#world is now private. Use Entity#getWorld or Entity#getServerWorld:

- World world = player.world;+ World world = player.getWorld();

RedstoneView provides redstone-related methods that previously existed in World.

Screen and rendering changes

DrawableHelper, a utility that is frequently used by subclassing it, turned into an object passed to rendering methods: DrawContext. This replaces the various MatrixStack matrices parameters. You usually do not need to construct one yourself.

- public void render(MatrixStack matrices) {- RenderSystem.setShaderTexture(0, TEXTURE);- drawTexture(matrices, ...);+ public void render(DrawContext context) {+ context.drawTexture(TEXTURE, ...); // texture ID is now specified here

The following new methods were added to DrawContext, replacing other methods in various places:

  • setShaderColor (wraps RenderSystem one, which still exists)
  • drawTextWithShadow (replaces TextRenderer#drawWithShadow)
  • drawText (wraps TextRenderer#draw)
  • drawTextWrapped
  • drawItem
  • drawItemWithoutEntity
  • drawItemInSlot
  • drawItemTooltip
  • drawTooltip (replaces Screen#renderTooltip)
  • drawHoverEvent

In addition, various rendering methods now take DrawContext instead of MatrixStack. If you still somehow need the matrix stack, you can use DrawContext#getMatrices.

Fabric API changes related to this:

  • Rendering API’s HudRenderCallback, Screen API’s ScreenEvents.beforeRender, and ScreenEvents.afterRender now take DrawContext instead of MatrixStack.
  • Screens.getItemRenderer is removed. This can be easily replaced with MinecraftClient#getItemRenderer, although this is usually not necessary.

And one unrelated change: Screen#passEvents was removed, therefore screens can no longer pass events.

Item group changes

ItemGroups are now registered in a registry. This means that the vanilla game tracks them using identifiers, just like blocks and items - and it is registered in the same way as those.

- public static final ItemGroup ITEM_GROUP = FabricItemGroup.builder(new Identifier(MOD_ID, "example"))- .icon(() -> new ItemStack(Items.DIAMOND_PICKAXE))- .displayName(Text.translatable("example-mod.group.example"))- .build();+ public static final RegistryKey<ItemGroup> ITEM_GROUP = RegistryKey.of(RegistryKeys.ITEM_GROUP, new Identifier(MOD_ID, "example"));++ @Override+ public void onInitialize() {+ Registry.register(Registries.ITEM_GROUP, ITEM_GROUP, FabricItemGroup.builder()+ .icon(() -> new ItemStack(Items.DIAMOND_PICKAXE))+ .displayName(Text.translatable("example-mod.group.example"))+ .build()); // build() no longer registers by itself+ }

Notice that FabricItemGroup#builder takes no arguments now, since the ID is assigned by the registry. Note, you must now call displayName manually or it will crash!

ItemGroupEvents.modifyEntriesEvent will now take RegistryKey<ItemGroup> instead of ItemGroup or Identifier. Note that vanilla ItemGroups fields are now registry keys, so code using those just needs to be recompiled. And with the game now providing the identifier, IdentifiableItemGroup is removed.

Finally, one small breaking change to Data Generation: FabricLanguageProvider.TranslationBuilder#add will now take RegistryKey<ItemGroup> instead of ItemGroup.

ItemStack changes

Code modifying ItemStack should now use the combined methods (such as copyWithCount) instead of 2 method calls (such as copy + setCount) to properly handle empty stacks. ItemStack#copyAndEmpty was added to move the contents of one stack into a new copy.

- ItemStack copy = stack.copy();- copy.setCount(1);+ ItemStack copy = stack.copyWithCount(1);

A couple of equality methods in ItemStack were removed:

  • ItemStack#isItemEqual: use the static areItemsEqual() method instead.
  • ItemStack#areNbtEqual: use canCombine (which also checks for items) or compare NBT yourself instead.

Loot changes

Predicates and item modifiers (or, in legacy terms, loot conditions and loot functions) are now managed by LootManager. They are identified using LootDataKey, similar to RegistryKey. getTable is renamed to getLootTable, and getElement can be used to get loot tables, predicates, or item modifiers.

LootContext.Builder is moved to LootContextParameterSet.Builder and its parameter method was renamed to add. The putDrop method was renamed to addDynamicDrop. The getNullable method was renamed to getOptional for consistency. The loot inventory seed is now given via supplyInventory.

Other small, but noteworthy changes

  • Fabric Content Registries’ VillagerPlantableRegistry was replaced with ItemTags.VILLAGER_PLANTABLE_SEEDS (data pack tags).
  • Herobrine was removed.
  • RecipeProvider#offerWoolDyeingRecipe and similar methods were merged to offerDyeableRecipes (which also offers re-coloring).
  • ServerCommandSource#sendFeedback now takes Supplier<Text> instead of Text for performance reasons. Add () -> and it should be good to go.
Fabric for Minecraft 1.20 (2024)

FAQs

Is Fabric or forge better? ›

Forge is the most popular and holds most of the more extensive mods, but Fabric and Quilt can run efficiently and allow more minor mods to run with any Minecraft version.

What version of Minecraft is Fabric compatible with? ›

What Minecraft versions does Fabric support? For most cases, the answer is “snapshot 18w43b and above, releases 1.14 and above”. There exist ways to run Fabric with older versions - modded or vanilla, but they're currently non-trivial or unofficial - see the expert FAQ for more details.

Do Fabric mods work with CurseForge? ›

It is possible to install Fabric and build a custom modded Minecraft experience for you and your friends using either CurseForge or MultiMC. To install Fabric on your dedicated server, you can follow our Knowledgebase article here.

Why choose Fabric over forge? ›

Although Fabric for snapshot versions exists, many mods are never made available for these versions. Fabric also makes fewer changes to the game and is, therefore, less prone to bugs. If you're only wanting to run a few mods, especially performance-orientated or client-side mods, Fabric is a clear winner.

Does Fabric work on 1.20 2? ›

Players should install the latest stable version of Fabric Loader (currently 0.14.22) to play 1.20.2.

Are CurseForge mods safe? ›

CurseForge has a large collection of mods which all go through a series of processors, automated checks, and manual reviewing. The team works hard to prevent abuse of the platform and puts in great efforts to make sure CurseForge is a safe, fun, and engaging space for authors and players alike.

Is 1.20 2 compatible with 1.20 1? ›

1.20.2 is a minor update to Java Edition, released on September 21, 2023, which adds the Villager Trade Rebalance experimental toggle and the /random command, and fixes bugs. This version is not compatible with 1.20 to 1.20.1 servers.

Does Fabric allow mods? ›

This guide explains how to install mods onto your Fabric client. Fabric, like Forge, is a version of Minecraft that allows for mods to be run on both the server and client. For clients, Fabric offers many mods such as minimaps, HUD improvements, OptiFine integrations, and more.

Can Fabric play with forge? ›

No, they are incompatible.

Is Fabric 1.20 out? ›

Minecraft 1.20 - the Trails and Tales Update - releases on June 7th 2023, again with a number of changes that impact many mods. As usual, we ask players to be patient, and give mod developers time to update to this new version. Here is a list of all major modder-facing changes in this version.

Is Fabric better than forge for modding? ›

Forge suits those seeking extensive and intricate mods, with patience for updates and hardware support. Fabric is ideal for those prioritizing quick updates and the latest versions.

Can you use mods without forge or Fabric? ›

You'll need a mod loader to run Minecraft mods. Loaders are essentially tools that make mods work in the first place, and only certain mods, like Optifine, can run without a mod loader. The most common loaders are Forge and Fabric, and choosing between the two depends on which mods you want to use.

Is Fabric and CurseForge the same? ›

In short, these are two different modloaders that help enable Minecraft modding as you know it in the CurseForge app. You can read more about Forge and Fabric documentation and the idea behind them.

Which modloader is best? ›

The best mod loader is Fabric so just go with that. NeoForge is just a CPR being done on Forge to keep the dead horse kicking and Quilt is not getting the same amount of traction that Fabric is getting.

What is the best version of Minecraft for mods? ›

As of June 2019, Minecraft 1.12. 2 has the most compatible mods, followed by 1.7. 10. Modding generally skips versions somewhat, with modders either adopting a version, or largely skipping it as a transitional version.

Top Articles
Latest Posts
Article information

Author: Kelle Weber

Last Updated:

Views: 5539

Rating: 4.2 / 5 (53 voted)

Reviews: 92% of readers found this page helpful

Author information

Name: Kelle Weber

Birthday: 2000-08-05

Address: 6796 Juan Square, Markfort, MN 58988

Phone: +8215934114615

Job: Hospitality Director

Hobby: tabletop games, Foreign language learning, Leather crafting, Horseback riding, Swimming, Knapping, Handball

Introduction: My name is Kelle Weber, I am a magnificent, enchanting, fair, joyous, light, determined, joyous person who loves writing and wants to share my knowledge and understanding with you.