Skip to content

Instantly share code, notes, and snippets.

Last active July 16, 2024 13:28
Show Gist options
  • Save ChampionAsh5357/d895a7b1a34341e19c80870720f9880f to your computer and use it in GitHub Desktop.
Save ChampionAsh5357/d895a7b1a34341e19c80870720f9880f to your computer and use it in GitHub Desktop.
Minecraft 1.20.5/6 -> 1.21 Mod Migration Primer

Minecraft 1.20.5/6 -> 1.21 Mod Migration Primer

This is a high level, non-exhaustive overview on how to migrate your mod from 1.20.5/6 to 1.21. This does not look at any specific mod loader, just the changes to the vanilla classes.

This primer is licensed under the Creative Commons Attribution 4.0 International, so feel free to use it as a reference and leave a link so that other readers can consume the primer.

If there's any incorrect or missing information, please leave a comment below. Thanks!

Pack Changes

There are a number of user-facing changes that are part of vanilla which are not discussed below that may be relevant to modders. You can find a list of them on Misode's version changelog.

Moving Experimental Features

All experimental features which were disabled with the update_1_21 flag are now moved to their proper locations and implementations. Removed features flags can be seen within

ResourceLocation, now Private

The ResourceLocation is final and its constructor is private. There are alternatives depending on your usecase:

  • new ResourceLocation(String, String) -> fromNamespaceAndPath(String, String)
  • new ResourceLocation(String) -> parse(String)
  • new ResourceLocation("minecraft", String) -> withDefaultNamespace(String)
  • of -> bySeparator
  • isValidResourceLocation is removed

Depluralizing Registry and Tag Folders

Plural references to the block, entity type, fluid, game event, and item tags have been removed. They should now use their exact registry name. The same goes for registry folders.

  • tags/blocks -> tags/block
  • tags/entity_types -> tags/entity_type
  • tags/fluids -> tags/fluid
  • tags/game_events -> tags/game_event
  • tags/items -> tags/item
  • advancements -> advancement
  • recipes -> recipe
  • structures -> structure'
  • loot_tables -> loot_table

Oh Rendering, why must you change so?

There have been a number of rendering changes. While this will not be an in-depth overview, it will cover most of the surface-level changes.

Vertex System

The vertex system has received a major overhaul, almost being completely rewritten. However, most of the codebase has some analogue to its previous version in different locations.

First, a VertexConsumer is obtained using one of two methods: from a MultiBufferSource or the Tesselator. Both essentially take a ByteBufferBuilder, which handles the direct allocation of the vertex information, and wrap it in a BufferBuilder, which writes the data to the ByteBufferBuilder while also keeping track of other settings needed to properly write the data, such as the VertexFormat.

The MultiBufferSource constructs a VertexConsumer via #getBuffer while Tesselator does so via Tesselator#begin.

// For some MultiBufferSource bufferSource
VertexConsumer buffer = bufferSource.getBuffer(RenderType.translucent());

// Note the different return types when using
// We will need the BufferBuilder subclass in the future
BufferBuilder buffer = Tesselator.getInstance().begin(VertexFormat.Mode.QUADS, DefaultVertexFormat.POSITION_TEX_COLOR);

Next, vertices are added to the VertexConsumer using the associated methods. #addVertex must always be called first, followed by the settings specified in the VertexFormat. #endVertex no longer exists and is called automatically when calling #addVertex or when uploading the buffer.

// For some VertexConsumer buffer
buffer.addVertex(0.0f, 0.0f, 2000.0f).setUv(0, 0).setColor(-1);
buffer.addVertex(0.0f, 1.0f, 2000.0f).setUv(0, 0).setColor(-1);
buffer.addVertex(1.0f, 1.0f, 2000.0f).setUv(0, 0).setColor(-1);
buffer.addVertex(1.0f, 0.0f, 2000.0f).setUv(0, 0).setColor(-1);

Once the vertices are added, those using MultiBufferSource are done. MultiBufferSource will batch the buffers together for each RenderType and call the BufferUploader within the pipeline. If the RenderType sorts the vertices on upload, then it will do so when endBatch is called, right before RenderType#draw is called to setup the render state and draw the data.

The Tesselator, on the other hand, does not handle this logic as you are creating the BufferBuilder instance to manage. In this case, after writing all ther vertices, BufferUploader#drawWithShader should be called. The MeshData provided, which contains the vertex and index buffer along with the draw state, can be built via BufferBuilder#buildOrThrow. This replaces BufferBuilder#end.

// For some BufferBuilder buffer


  • com.mojang.blaze3d.vertex.DefaultVertexFormat's VertexFormatElements have been moved to VertexFormatElement.
  • com.mojang.blaze3d.vertex.BufferBuilder$RenderedBuffer -> MeshData
  • com.mojang.blaze3d.vertex.VertexConsumer
    • vertex -> addVertex
      • Overload with PoseStack$Pose, Vector3f
    • color -> setColor
    • uv -> setUv
    • overlayCoords -> setUv1, setOverlay
    • uv2 -> setUv2, setLight
    • normal -> setNormal
    • endVertex is removed
    • defaultColor, color -> setColor, setWhiteAlpha
  • net.minecraft.client.model.Model#renderToBuffer now takes in an integer representing the ARGB tint instead of four floats
    • There is also a final method which passes in no tint
  • net.minecraft.client.model.geom.ModelPart#render, $Cube#compile now takes in an integer representing the ARGB tint instead of four floats
    • There is also an overloaded method which passes in no tint
  • net.minecraft.client.particle.ParticleRenderType#begin(Tesselator, TextureManager), end -> begin(BufferBuilder, TextureManager)
    • This method returns the BufferBuilder rather than void
    • When null, no rendering will occur
  • Shader removals and replacements
    • minecraft:position_color_tex -> minecraft:position_tex_color
    • minecraft:rendertype_armor_glint -> minecraft:rendertype_armor_entity_glint
    • minecraft:rendertype_glint_direct -> minecraft:rendertype_glint
  • net.minecraft.client.renderer.MultiBufferSource
    • All BufferBuilders have been replaced with ByteBufferBuilder
    • immediateWithBuffers now takes in a SequencedMap
  • net.minecraft.client.renderer.RenderType
    • end -> draw
    • sortOnUpload - When true, sorts the quads according to the VertexSorting method for the RenderType
  • net.minecraft.client.renderer.SectionBufferBuilderPack#builder -> #buffer
  • net.minecraft.client.renderer.ShaderInstance no longer can change the blend mode, only EffectInstance can, which is applied for PostPass
    • setDefaultUniforms - Sets the default uniforms accessible to all shader instances
  • net.minecraft.client.renderer.entity.ItemRenderer
    • getArmorFoilBuffer no longer takes in a boolean to change the render type
    • getCompassFoilBufferDirect is removed
  • net.minecraft.client.renderer.entity.layers.RenderLayer#coloredCutoutModelCopyLayerRender, renderColoredCutoutModel takes in an integer representing the color rather than three floats
  • com.mojang.blaze3d.vertex.BufferVertexConsumer is removed
  • com.mojang.blaze3d.vertex.DefaultedVertexConsumer is removed

Chunk Regions

  • net.minecraft.client.renderer.chunk.RenderRegionCache#createRegion only takes in the SectionPos now instead of computing the section from the BlockPos
  • net.minecraft.client.renderer.chunk.SectionCompiler - Renders the given chunk region via #compile. Returns the results of the rendering compilation.
    • This is used within SectionRenderDispatcher now to pass around the stored results and upload them

The Enchantment Datapack Object

Enchantments are now a datapack registry object. Querying them requires access to a HolderLookup.Provider or one of its subclasses.

All references to Enchantments are now wrapped with Holders. Some helpers can be found within EnchantmentHelper.

    // A component containing the description of the enchantment
    // Typically will be a component with translatable contents
    "description": {
        "translate": "enchantment.minecraft.example"
    // An item tag that holds all items this enchantment can be applied to
    "supported_items": "#minecraft:enchantable/weapon",
    // An item tag that holds a subset of supported_items that this enchantment can be applied to in an enchanting table
    "primary_items": "#minecraft:enchantable/sharp_weapon",
    // A non-negative integer that provides a weight to be added to a pool when trying to get a random enchantment
    "weight": 3,
    // A non-negative integer that indicates the maximum level of the enchantment
    "max_level": 4,
    // The minimum cost necessary to apply this enchantment to an item
    "min_cost": {
        // The base cost of the enchantment at level 1
        "base": 10,
        // The amount to increase the cost with each added level
        "per_level_above_first": 20
    // The maxmimum cost required to apply this enchantment to an item
    "max_cost": {
        "base": 60,
        "per_level_above_first": 20
    // A non-negative integer that determines the cost to add this enchantment via the anvil
    "anvil_cost": 5,
    // The equipment slot groups this enchantment is applied to
    // Can be 'any', 'hand' ('mainhand' and 'offhand'), 'armor' ('head', 'chest', 'legs', and 'feet'), or 'body'
    "slots": [
    // An enchantment tag that contains tags that this enchantment cannot be on the same item with
    "exclusive_set": "#minecraft:exclusive_set/damage",
    // An encoded data component map which contains the effects to apply
    "effects": {
        // Read below


EnchantmentEffectComponents essentially apply how enchantments should react in a given context when on an item. Each effect component is encoded as an object with its component id as the key and the object value within the effect list, usually wrapped as a list. Most of these components are wrapped in a ConditionalEffect, so that will be the focus of this primer.


ConditionalEffects are basically a pair of the effect to apply and a list of loot conditions to determine when to execute the enchantment. The codec provided contains the effect object code and the loot context param sets to apply for the conditions (commonly one of the ENCHANTED_* sets).

The Effect Objects

Each effect object has its own combination of codecable objects and abstract logic which may refer to other registered types, similiar to loot conditions, functions, number providers, etc. For enchantments currently, this means enchantments which are applied directly to the entity, scaled and calulated for some numerical distribution, applied to the blocks around the entity, or calculating a number for some information.

For example, all protection enchantments use almost the exact same effect objects (minecraft:attributes and minecraft:damage_protection) but use the conditions to differentiate when those values should be applied.

To apply these enchantments, EnchantmentHelper has a bunch of different methods to help with the application. Typically, most of these are funneled through one of the runIterationOn* methods. These method take in the current context (e.g., stack, slot, entity) and a visitor which holds the current enchantment, level, and optionally the stack context if the item is in use. The visitor takes in a mutable object which holds the final value to return. The modifications to apply to the given item(s) are within Enchantment#modify*. If the conditions match, then the value from the mutable object is passed in, processed, and set back to the object.

Enchantment Providers

EnchantmentProviders are a provider of enchantments to items for entity inventory items or for custom loot on death. Each provider is some number of enchantments that is then randomly selected from and applied to the specified stacks via EnchantmentHelper#enchantItemFromProvider which takes in the stack to enchant, the registry access, the provider key, the difficulty instance, and the random instance.

Minor Changes

  • - Returns the enchantments which depend on the current location of the entity
  • has been removed
  •$ItemListing implementations with Enchantments now take in keys or tags of the corresponding object
  • - Gets the dmaage of a source modified by the current enchantments
  • - Applies the enchantment modifiers when a block is hit
  • has been removed
  • takes in a Holder<Enchantment> instead of the direct object
  •, enchantSpawnedWeapon, enchantSpawnedArmor now take in a ServerLevelAccessor and DifficultyInstance

The Painting Variant Datapack Object

PaintingVariants are now a datapack registry object. Querying them requires access to a HolderLookup.Provider or one of its subclasses.

    // A relative location pointing to 'assets/<namespace>/textures/painting/<path>.png
    "asset_id": "minecraft:courbet",
    // A value between 1-16 representing the number of blocks this variant takes up
    // e.g. a width of 2 means it takes up 2 blocks, and has an image size of 32px
    "width": 2,
    // A value between 1-16 representing the number of blocks this variant takes up
    // e.g. a height of 1 means it takes up 1 blocks, and has an image size of 16px
    "height": 1

Attribute Modifiers, now with ResourceLocations

AttributeModifiers no longer take in a String representing its UUID. Instead, a ResourceLocation is provided to uniquely identity the modifier to apply. Attribute modifiers can be compared for ResourceLocations using #is.

    • addAttributeModifier, $AttributeTemplate takes in a ResourceLocation instead of a String
    • getModifiers returns a Map<ResourceLocation, AttributeModifier>
    • getModifier, hasModifier, removeModifier now takes in a ResourceLocation
    • removeModifier now returns a boolean
    • removePermanentModifier is removed
    • addOrReplacePermanentModifier - Adds or replaces the provided modifier
    • getModifierValue, hasModifier, now takes in a ResourceLocation
    • getModifierValue, hasModifier, now takes in a ResourceLocation


Recipes now take in a instead of a Container. A RecipeInput is basically a minimal view into a list of available stacks. It contains three methods:

  • getItem - Returns the stack in the specified index
  • size - The size of the backing list
  • isEmpty - true if all stacks in the list are empty

As such, all implementations which previous took a Container now take in a RecipeInput. You can think of it as replacing all the C generics with a T generic representing the RecipeInput. This also includes RecipeHolder, RecipeManager, and the others below.


CraftingInput is an implementation of RecipeInput which takes in width and height of the grid along with a list of ItemStacks. One can be created using CraftingInput#of. These are used in crafting recipes.


SingleRecipeInput is an implementation of RecipeInput that only has one item. One can be created using the constructor.

Changing Dimensions

How entities change dimensions have been slightly reworked in the logic provided. Instead of providing a PortalInfo to be constructed, instead everything returns a DimensionTransition. DimensionTransition contains the level to change to, the entity's position, speed, and rotation, and whether a respawn block should be checked. DimensionTransition replaces PortalInfo in all scenarios.

Entities have two methods for determining whether they can teleport. Entity#canUsePortal returns true if the entity can use a Portal to change dimensions, where the boolean supplies allows entities who are passengers to teleport. To actually change dimensions, Entity#canChangeDimensions must return true, where the current and teleporting to level is provided. Normally, only canUsePortal is changed while canChangeDimensions is always true.

canChangeDimensions functioned as canUsePortal in 1.20.5/6.

To change dimensions via a portal, a Portal should be supplied to Entity#setAsInsidePortal. A Portal contains how long it takes for the portal to transition, the DimensionTransition destination, and the transition effect to apply to the user. This is all wrapped in a PortalProcessor and stored on the Entity. Once the player is teleported a DimensionTransition$PostDimensionTransition is executed, for example playing a sound.

Portals are generally implmented on the Block doing the teleporting.

    • changeDimension(ServerLevel) -> changeDimension(DimensionTransition)
    • findDimensionEntryPoint -> Portal#getPortalDestination
    • getPortalWaitTime -> Portal#getPortalTransitionTime
    • handleInsidePortal -> setAsInsidePortal
    • handleNetherPortal -> handlePortal
    • teleportToWithTicket is removed
    • getRelativePortalPosition is now public
    • createPortalInfo is removed
    • findCollisionFreePosition is now public
  • net.minecraft.client.player.LocalPlayer#getActivePortalLocalTransition - Defines the transition to apply to the entity when the player is within a portal
  • -> findClosestPortalPosition

Minor Changes

  • net.minecraft.recipebook.ServerPlaceRecipe now has a generic taking in the RecipeInput and the Recipe rather than the Container
  • - Converts a crafting container to an input to supply
  • - Converts a crafting container to an input positioned at some location within a grid
  • now takes in a RecipeHolder
  • now has a generic taking in the RecipeInput and the Recipe rather than the Container
    • beginPlacingRecipe - When the recipe is about to be placed in the corresponding location
    • finishPlacingRecipe - AFter the recipe has been placed in the corresponding location
  • net.minecraft.client.gui.screens.recipebook.*RecipeComponent#addItemToSlot still exists but is no longer overridded from its subclass

Minor Migrations

The following is a list of useful or interesting additions, changes, and removals that do not deserve their own section in the primer.

Options Screens Movement

The options screens within net.minecraft.client.gui.screens and net.minecraft.client.gui.screens.controls have been moved to net.minecraft.client.gui.screens.options and net.minecraft.client.gui.screens.options.controls, respectively.

The HolderLookup$Provider in LootTableProvider$SubProviderEntry takes in a function which provides the HolderLookup$Provider and returns the LootTableSubProvider. LootTableSubProvider#generate no longer takes in a HolderLookup$Provider as its first argument.

DecoratedPotPattern Object

Registries#DECORATED_POT_PATTERNS takes in a DecoratedPotPattern instead of the raw string for the asset id. This change has been reflected in all subsequent classes (e.g. Sheets).

Jukebox Playable

RecordItems has been removed in favor of a new data component JukeboxPlayable. This is added via the item properties. A jukebox song is played via JukeboxSongPlayer. JukeboxBlockEntity handles an implementation of JukeboxSongPlayer, replacing all of the logic handling within the class itself.

  •$Properties#jukeboxPlayable - Sets the song to play in a jukebox when this is added
  • - A SoundEvent, description, length, and comparator output record indicating what this item would do when placed in a jukebox
    • This is a datapack registry
  • - The data component for a JukeboxSong
  • - A player which handles the logic of how a jukebox song is played
  • - Gets the comparator output of the song playing in the jukebox

Chunk Generation Reorganization

Chunk generation has been reorganized again, where generation logic is moved into separate maps, task, and holder classes to be executed and handled asyncronously in most instances. Missing methods can be found in ChunkGenerationTask, GeneratingChunkMap, or GenerationChunkHolder. Additional chunk generation handling is within*.

This also means some region methods which only contain generation-based information have been replaced with one of these three classes instead of their constructed counterparts. The steps are now listed in a ChunkPyramid, which determines the steps takes on how a protochunk is transformed into a full chunk. Each step can have a ChunkDependencies, forcing the order of which they execute. ChunkPyramid#GENERATION_PYRAMID handles chunk generation during worldgen while LOADING_PYRAMID handles loading a chunk that has already been generated. The WorldGenContext holds a reference to the main thread box when necessary.

Delta Tracker

net.minecraft.client.DeltaTracker is an interface mean to keep track of the delta ticks, both ingame and real time. This also holds the current partial tick. This replaces most instances passing around the delta time or current partial tick.

  • net.minecraft.client.Minecraft#getFrameTime, getDeltaFrameTime -> getTimer
  • net.minecraft.client.Timer -> DeltaTracker$Timer
  • net.minecraft.client.gui.Gui#render now takes in a DeltaTracker


  • com.mojang.realmsclient.dto.RealmsServer#isMinigameActive - Returns whether a minigame is active.
  • net.minecraft.SystemReport#sizeInMiB - Converts a long representing the number of bytes into a float representing Mebibyte (Power 2 Megabyte)
  • net.minecraft.Util#isSymmetrical - Checks whether a list, or some subset, is symmetrical
  • net.minecraft.advancements.critereon.MovementPredicate - A predicate which indicates how the entity is currently moving
  • net.minecraft.client.gui.components.AbstractSelectionList#clampScrollAmount - Clamps the current scroll amount
  • net.minecraft.client.gui.screens.AccessibilityOnboardingScreen#updateNarratorButton - Updates the narrator button
  • net.minecraft.client.gui.screens.worldselection.WorldCreationContext#validate - Validates the generators of all datapack dimensions
  • net.minecraft.client.multiplayer.ClientPacketListener
    • updateSearchTrees - Rebuilds the search trees for creative tabs and recipe collections
    • searchTrees - Gets the current search trees for creative tabs and recipe collections
  • net.minecraft.client.multiplayer.SessionSearchTrees - The data contained for creative tabs and recipe collections on the client
  • net.minecraft.commands.arguments.item.ItemParser$Visitor#visitRemovedComponent - Executed when a component is to be removed as part of an item input
  • net.minecraft.core.Registry#getAny - Gets an element from the registry, usually the first one registered
  • net.minecraft.core.component.DataComponentMap
    • makeCodec - Creates a component map codec from a component type codec
    • makeCodecFromMap - Creates a component map codec from a component type to object map codec
  • net.minecraft.util.ProblemReporter#getReport - Returns a report of the problem
  • net.minecraft.util.Unit#CODEC
  • - Returns a source where the damage was from a campfire
    • hasLandedInLiquid - Returns whether the entity is moving faster than -0.00001 in the y direction while in a liquid
    • getKnockback - Gets the knockback to apply to the entity
  • - Executes when the mob should play a sound when attacking
    • addTransientAttributeModifiers - Adds all modifiers from the provided map
    • removeAttributeModifiers - Removes all modifiers in the provided map
    • getWeaponItem - The weapon the arrow was fired from
    • setBaseDamageFromMob - Sets the base damage this arrow can apply
  • - Returns the horizontal vector of the knockback direction
  • - A slot for armor
  • - Sets the sounds to play when pulling back the crossbow
  • - Gets called after the enemy has been hurt by this item
  • - Returns whether the explosion cna trigger a block
  • - Plays the lever click sound
    • unobstructed - Returns a predicate which indicates the current vector is not obstructed by another entity
  • - A function which grows the loot based on the corresponding enchantment level
  • - Checks whether a given enchantment is applied
  • - Determines the enchantment level to provide
  • - An overload of #move which takes in a Vector3f
  • net.minecraft.core.dispenser.DefaultDispenseItemBehavior#consumeWithRemainder - Shrinks the first item stack. If empty, then the second item stack is returned. Otherwise, the second item stack is added to an inventory or dispensed, and the first item stack is returned.
  • net.minecraft.server.MinecraftServer
    • throwIfFatalException - Throws an exception if its variable isn't null
    • setFatalException - Sets the fatal exception to throw
  • net.minecraft.util.StaticCache2D - A two-dimensional read-only array which constructs all objects on initialization
    • fudgePositionAfterSizeChange - Returns whether the entity's position can be moved to an appropriate free position after its dimension's change
    • getKnownMovement - Returns the current movement of the entity, or the last known client movement of the player
    • setSentiment - Sets whether the attribute provides a positive, neutral or negative benefit when the value is positive
    • getStyle - Gets the chat formatting of the text based on the sentiment and whether the attribite value is positive
  • - Returns the attributes to sync to the client
  •$Builder#withOptionalRandomSource - Sets the random source to use for the loot context during generation
    • This is passed by LootTable#getRandomItems(LootParams, RandomSource)
  • net.minecraft.client.Options#genericValueOrOffLabel - Gets the generic value label, or an on/off component if the integer provided is 0
  • net.minecraft.client.gui.GuiGraphics#drawStringWithBackdrop - Draws a string with a rectangle behind it
  • net.minecraft.gametest.framework.GameTestHelper
    • assertBlockEntityData - Asserts that the block entity has the given information
    • assertEntityPosition - Asserts that the enity position is within a bounding box
  • net.minecraft.server.level.ServerPlayer#copyRespawnPosition - Copies the respawn position from another player
  • net.minecraft.server.players.PlayerList#sendActiveEffects, sendActivePlayerEffects - Sends the current entity's effects to the client using the provided packet listener
  • net.minecraft.util.Mth#hsvToArgb - Converts an HSV value with an alpha integer to ARGB
  • - Rotates the y and x of the entity clamped between its maximum values
  • - Sets the base value for each attribute in the map
  • - An overload which applies the modifier for each equipment slot in the group
    • Applies to as well
  • - Constructs a random instance from a seed
  • - The padding to apply above and below a structure when attempting to generate
  • net.minecraft.ReportType - An object that represents a header plus a list of nuggets to display after the header text
  • net.minecraft.advancements.critereon.GameTypePredicate - A predicate that checks the game type of the player (e.g. creative, survival, etc.)
  • net.minecraft.advancements.critereon.ItemJukeboxPlayablePredicate - A predicate that checks if the jukebox is playing a song
  • net.minecraft.core.BlockPos#clampLocationWithin - Clamps the vector within the block
  • net.minecraft.core.registries.Registries
    • elementsDirPath - Gets the path of the registry key
    • tagsDirPath - Gets the tags path of the registry key (replaces TagManager#getTagDir
  • - Information as to why the user was disconnected from the current world
  • net.minecraft.server.MinecraftServer#serverLinks - A list of entries indicating what the link coming from the server is
    • Only used for bug reports
  • net.minecraft.util.FastColor
    • $ABGR32#fromArgb32 - Reformats an ARGB32 color into a ABGR32 color
    • $ARGB32#average - Averages two colors together by each component
  • net.minecraft.util.Mth#lengthSquared - Returns the squared distance of three floats
  • - Trigers the mob effects when an entity is killed
    • tryToTeleportToOwner - Attempts to teleport to the entity owner
    • shouldTryTeleportToOwner - Returns true if the entity owner is more than 12 blocks away
    • unableToMoveToOwner - Returns true if the animal cannot move to the entity owner
    • canFlyToOwner - Returns true if the animal can fly to the owner
  • - Removes the owner of the projectile
  • - A holder which either contains the holder instance or a resource key
  • - Returns whether the section only has air
  • net.minecraft.FileUtil#sanitizeName - Replaces all illegal file charcters with underscores
  • net.minecraft.Util#parseAndValidateUntrustedUri - Returns a URI after validating that the protocol scheme is supported
  • net.minecraft.client.gui.screens.ConfirmLinkScreen now has two overloads to take in a URI
    • confirmLinkNow and confirmLink also has overloads for a URI parameter
  • net.minecraft.client.renderer.LevelRenderer#renderFace - Renders a quad given two points and a color
  • net.minecraft.client.renderer.entity.EntityRenderer#renderLeash - A private method that renders the leash for an entity
  • net.minecraft.client.resources.model.BlockStateModelLoader - Loads the blockstate definitions for every block in the registry
    • Anything missing from ModelBakery is most likely here
  • net.minecraft.client.resources.model.ModelBakery$TextureGetter - Gets the TextureAtlasSprite given the model location and the material provided
  • net.minecraft.core.BlockPos#getBottomCenter - Gets the Vec3 representing the bottom center of the position
  • net.minecraft.gametest.framework.GameTestBatchFactory#fromGameTestInfo(int) - Batches the game tests into the specified partitions
  • net.minecraft.gametest.framework.GameTestHelper#getTestRotation - Gets the rotation of the structure from the test info
  • net.minecraft.gametest.framework.GameTestRunner$StructureSpawner#onBatchStart - Executes when the batch is going to start running within the level
    • id - The id of the protocol
    • flow - The direction the packet should be sent
    • listPackets - Provides a visitor to all packets that can be sent on this protocol
  • - Creates a component for a URI
  • - Returns the base vector before encoding
  • net.minecraft.server.level.ServerEntity
    • getPositionBase - Returns the current position of the entity
    • getLastSentMovement - Gets the vector representing the last velocity of the entity sent to the client
    • getLastSentXRot - Gets the last x rotation of the entity sent to the client
    • getLastSentYRot - Gets the last y rotation of the entity sent to the client
    • getLastSentYHeadRot - Gets the last y head rotation of the entity sent to the client
  • - Returns the itemstack the direct entity had
    • adjustSpawnLocation - Returns the block pos representing the spawn location of the entity. By default, returns the entity spawn location
    • moveTo has an overload taking in a Vec3
    • placePortalTicket - Adds a region ticket that there is a portal at the BlockPos
    • getPreciseBodyRotation - Lerps between the previous and current body rotation of the entity
    • getWeaponItem - The item the entity is holding as a weapon
  • - Indicates that an entity can be leashed
    • dropPreservedEquipment - Drops the equipment the entity is wearing if it doesn't match the provided predicate or if the equipment succeeds on the drop chance check
    • setIgnoreFallDamageFromCurrentImpulse - Ignores the fall damage from the current impulses for 40 ticks when true
    • tryResetCurrentImpulseContext - Resets the impulse if the grace time reaches 0
  • - Hurts the stack and when the item breaks, sets the item to another item
  • - Handles error reporting for chunk IO failures
  •, IOWorker, RegionFileStorage, SimpleRegionStorage#storageInfo - Returns the RegionStorageInfo used to store the chunk
  •$StructureSettings now has a constructor with default values given the biome tag
    • $Builder - Builds the settings for the structure
  • - The settings to apply for blocks spawning with liquids within them
  • now has an constructor overload taking in an empty HolderGetter$Provider
    • allowsReferences - Checks whether the resolver is present
  • net.minecraft.client.Options#onboardingAccessibilityFinished - Disables the onboarding accessibility feature
  • net.minecraft.client.gui.screens.reporting.AbstractReportScreen
    • createHeader - Creates the report header
    • addContent - Adds the report content
    • createFooter - Creates the report footer
    • onReportChanged - Updates the report information, or sets a CannotBuildReason if not possible to change
  • - Sets whether the user has read the report and wants to send it
  • - A feature that generates the end platform
  • - A placement that places a feature in one of the provided positions
    • getBottomCenter - Gets the Vec3 representing the bottom center of the box
    • getMinPosition - Gets the Vec3 representing the smallest coordinate of the box
    • getMaxPosition - Gets the Vec3 representing the largest coordinate of the box
  • - Returns whether the player should ignore fall damage
  • - Returns a list of Leashable entities within a 7 block radius of the provided block position


  • net.minecraft.advancements.critereon.EnchantmentPredicate now takes in a HolderSet<Enchantment
    • The previous constructor still exists as an overload
  • net.minecraft.advancements.critereon.EntityFlagsPredicate now takes in a boolean for if the entity is on the ground or flying
  • net.minecraft.advancements.critereon.EntityPredicate now takes in a movement predicate and periodic tick which indicates when the predicate can return true
  • net.minecraft.advancements.critereon.LocationPredicate now takes in a fluid predicate
  • net.minecraft.client.gui.components.AbstractSelectionList#setScrollAmount -> setClampedScrollAmount
    • setScrollAmount now delegates to this method
  • net.minecraft.client.gui.components.OptionsList now longer takes in the unused integer
  • net.minecraft.client.gui.screens.inventory.CreativeModeInventoryScreen now takes in a LocalPlayer instead of a Player
  • net.minecraft.client.resources.language.LanguageManager now takes in a Consumer<ClientLanguage> which acts as a callback when resources are reloaded
  • net.minecraft.client.searchtree.PlainTextSearchTree -> SearchTree#plainText
  • net.minecraft.client.searchtree.RefreshableSearchTree -> SearchTree
  • net.minecraft.commands.arguments.item.ItemInput now takes in a DataComponentPatch instead of a DataComponentMap
  • net.minecraft.core.component.TypedDataComponent#createUnchecked is now public
  • now takes in a HolderLookup$Provider
    • HAS_SILK_TOUCH -> hasSilkTouch
    • HAS_NO_SILK_TOUCH -> doesNotHaveSilkTouch
    • HAS_SHEARS_OR_SILK_TOUCH -> hasShearsOrSilkTouch
    • HAS_NO_SHEARS_OR_SILK_TOUCH -> doesNotHaveShearsOrSilkTouch
    • Most protected static methods were turned into instance methods
  • now takes in a HolderLookup$Provider
  • is now protected
  • net.minecraft.recipebook.ServerPlaceRecipe
    • addItemToSlot now takes in an Integer instead of a Iterator<Integer>
    • moveItemToGrid now takes in an integer representing the minimum count and returns the number of items remaining that can be moved with the minimum count in place
  • net.minecraft.resources.RegistryDataLoader
    • load is now private
    • $RegistryData now takes in a boolean indicating whether the data must have an element
  • now takes in a LivingEntity
  • now takes in a float
    • onChangedBlock now takes in a ServerLevel
    • getExperienceReward -> getBaseExperienceReward
      • getExperienceReward is now final and takes in the ServerLevel and Entity
    • getRandom -> Entity#getRandom (usage has not changed)
    • dropExperience now takes in a nullable Entity
    • dropCustomDeathLoot no longer takes in an integer
    • jumpFromGround is now public for testing
  • now keeps track of the weapon it was fired from
  •$startAutoSpinAttack now takes in a float representing the damage and a stack representing the item being held
  • now keeps track of the weapon it was fired from
    • setPierceLevel is now private
  • now keeps track of the weapon it was fired from
  • now takes in an ItemStack and LivingEntity
    • getAttackDamageBonus now takes in an Entity and DamageSource instead of just the Player
    • getUseDuration now takes in a LivingEntity
    • hurtAndBreak now takes in a ServerLevel instead of a RandomSource
    • hurtEnemy now returns a boolean if the entity was succesfully hurt
  • takes in a LivingEntity instead of a Player
  • takes in a ServerLevel instead of a Level
    • update now takes in a DynamicOps<Tag>
    • read now has an overload that takes in a DynamicOps<Tag>
  •$ExplosionInteraction now implements StringRepresentable
  •$WindChargeDamageCalculator ->
  • now takes in a nullable Player
  • now takes in a nullable Player and does not return anything
  •, DIRECT_CODEC, CODEC have been moved to LootItemCondition
  • -> LootItemRandomChanceWithEnchantedBonusCondition
  • is now public
  • net.minecraft.advancements.critereon.DamageSourcePredicate now takes in a boolean of if the damage source is direct
  • net.minecraft.client.gui.components.SubtitleOverlay$Subtitle is now package private
  • takes in an accelerationPower double instead of power for each of the coordinate components
  •*a now provides the double representing the actual acceleration vector of the coordinate instead of the shifted integer
  • has been replaced with isDirect, which does the opposite check
  • now contains an overload that takes in a Vec3
  • is now final
    • A separate overload taking in the FoodProperties can now be overridden
  • -> getAttributestoUpdate
  •, HITBOX_HEIGHT is now final
  • now throws an error if called on the logical client
  • constructors now take in Vec3 to assign the directional movement of the acceleration power rather than the coordinate powers
    • xPower, yPower, zPower -> accelerationPower
  • -> eat(FoodProperties)
  • now takes in a stack representing what the food turns into once eaten
  • no longer takes in an ItemStack
    • transmuteCopy now has an overload which takes in the current count
    • transmuteCopyIgnoreEmpty is now private
  • now has an overload to take in the x and z coordinates without being wrapped in a ChunkPos
  • now takes in a LivingEntity instead of an Entity
  • now takes in a LivingEntity instead of an Entity
  • -> getPersistedStatus
  •, fillFromNoise no longer takes in an Executor
  • now takes in a DimensionPadding when determining the starting generation point
    • glBindBuffer(int, IntSupplier) -> glBindBuffer(int, int)
    • glBindVertexArray(Supplier<Integer>) -> glBindVertexArray(int)
    • setupOverlayColor(IntSupplier, int) -> setupOverlayColor(int, int)
  • net.minecraft.advancements.critereon.EntityPredicate#location, steppingOnLocation has been wrapped into a $LocationWrapper subclass
    • This does not affect currently generated entity predicates
  • net.minecraft.client.Options#menuBackgroundBlurriness, getMenuBackgroundBlurriness now returns an integer
  • net.minecraft.client.renderer.GameRenderer#MAX_BLUR_RADIUS is now public and an integer
  • net.minecraft.gametest.framework.GameTestHelper#getBlockEntity now throws an exception if the block entity is missing
  • now takes in the y and x rotation of the item
  • net.minecraft.server.level.ServerLevel#addDuringCommandTeleport, #addDuringPortalTeleport have been combined into addDuringTeleport by checking whether the entity is a ServerPlayer
  • net.minecraft.server.level.ServerPlayer#seenCredits is now public
  • net.minecraft.server.players.PlayerList#respawn now takes in an Entity$RemovalReason
  •, int, int) -> numberOfSlimesToSpawn(int, NearbySlimes, int)
    • setOnGroundWithKnownMovement -> setOnGroundWithMovement
    • getBlockPosBelowThatAffectsMyMovement is now public
  • now takes in an integer represent the max count the slot can have, or 0 if unrestricted
    • Can be applied via limit which splits the current item stack
    • dropAllDeathLoot, dropCustomDeathLoot now takes in a ServerLevel
    • broadcastBreakEvent -> onEquippedItemBroken
    • getEquipmentSlotForItem is now an instance method
  • -> assignAllValues
  • now takes in a ServerLevel
  • now takes in a Consumer of the broken Item instead of a Runnable
  • net.minecraft.CrashReport
    • getFriendlyReport and saveToFile now takes in a ReportType and a list of header strings
      • There is also an overload that just takes in the ReportType
    • getSaveFile now returns a Path
  • net.minecraft.client.gui.screens.DisconnectedScreeen can now take in a record containing the disconnection details
    • DisConnectionDetails provide an optional path to the report and an optional string to the bug report link
  • net.minecraft.client.renderer.LevelRenderer#playStreamingMusic -> playJukeboxSong
    • stopJukeboxSongAndNotifyNearby stops playing the current song
  • net.minecraft.client.resources.sounds.SimpleSoundInstance#forRecord -> forJukeboxSong
  • net.minecraft.client.resources.sounds.Sound now takes in a ResourceLocation instead of a String
    • onDisconnect now takes in DisconnectionDetails instead of a Component
    • fillListenerSpecificCrashDetails now takes in a CrashReport
  • net.minecraft.server.MinecraftServer
    • getServerDirectory, getFile now returns a Path
    • isNetherEnabled -> isLevelEnabled
  • now takes in a Function<PathfinderMob, TagKey<DamageType>> instead of a simple Predicate
  • no longer takes in a boolean checking whether the entity can fly
    • These methods have been moved to TamableAnimal
  • now takes in a Function<PathfinderMob, TagKey<DamageType>> instead of a simple Predicate
  • now returns a boolean indicating whether the deflection was successful
  • -> getBackgroundTexture
  • -> getTextureDiffuseColor
  •$BeaconBeamSection#getColor now returns an integer
  • no longer takes in a directory, instead it grabs that from the location of the ResourceKey
  • net.minecraft.client.gui.screens.Scnree#narrationEnabled -> updateNarratorStatus(boolean)
  • net.minecraft.client.gui.screens.inventory.HorseInventoryScreen takes in an integer representing the number of inventory columns to display
  • net.minecraft.client.renderer.block.model.BlockElementFace is now a record
  • net.minecraft.client.resources.model.ModelBakery#getModel is now package-private
  • net.minecraft.client.resources.model.ModelResourceLocation is now a record
    • inventory method for items
  • net.minecraft.client.resources.model.UnbakedModel#bakeQuad no longer takes in a ResourceLocation
  • net.minecraft.core.BlockMath#getUVLockTransform no longer takes in a Supplier<String>
  • net.minecraft.gametest.framework.GameTestBatchFactory#toGameTestBatch is now public
  • net.minecraft.gametest.framework.GameTestRunner now takes in a boolean indicating whether to halt on error
    • serverboundProtocolUnbound -> serverboundProtocol
    • clientboundProtocolUnbound -> clientboundProtocol
  • now takes in the ServerEntity for the first two packet constructors
  • net.minecraft.server.MinecraftServer now implements ChunkIOErrorReporter
  • net.minecraft.util.ExtraCodecs#QUATERNIONF_COMPONENTS now normalizes the quaternion on encode
  • now takes in a ServerEntity
  • leash methods have been moved to Leashable
  • now takes in the ItemStack being equipped
  • now takes in a ChunkIOErrorReporter
  • now takes in a RegionStorageInfo
  • now takes in a ChunkIOErrorReporter
  • now takes in LiquidSettings
  • now takes in LiquidSettings
  • now takes in an Optional<LiquidSettings>
    • getSettings now takes in LiquidSettings
  • now takes in an LiquidSettings
    • single also has overloads that takes in LiquidSettings
  • now takes in LiquidSettings
  • -> shouldApplyWaterlogging
  •, createPathToStructure -> createAndValidatePathToGeneratedStructure
  • now takes in a float representing the chance to unenchant the item
  •'s constructor is now public
  •'s constructor is now protected
  • net.minecraft.client.gui.components.Checkbox now takes in a max width which can be passed in through the builder via Checkbox$Builder#maxWidth
  • net.minecraft.client.gui.components.MultiLineLabel
    • create methods with FormattedText has been removed
    • create methods with Lists now take in a component varargs
    • createFixed -> create
    • renderCentered, renderLeftAligned no longer return anything
    • renderBackgroundCentered is removed
    • TextAndWidth is now a record
  • net.minecraft.commands.arguments.selector.EntitySelector#predicate -> contextFreePredicate
    • Takes in a List<Predicate<Entity>> now
    • isWithinBounds now has overloads for Vec3 and four doubles representing two xz coordinates
    • clampToBounds now has overloads for BlockPos and Vec3
    • clampToBounds(AABB) is removed
  • net.minecraft.server.level.ServerPlayer#onInsideBlock is now public, only for this overload


  • net.minecraft.client.Minecraft
    • getSearchTree, populateSearchTree
    • renderOnThread
  • net.minecraft.client.searchtree.SearchRegistry
  • net.minecraft.entity.LivingEntity#canSpawnSoulSpeedParticle, spawnSoulSpeedParticle
    • setKnockback, getKnockback
    • setShotFromCrossbow
    • initGameThread, isOnGameThread
    • assertInInitPhase, isInInitPhase
    • assertOnGameThreadOrInit, assertOnGameThread
  • net.minecraft.client.gui.screens.Screen#advancePanoramaTime
    • Use canUseSlot(EquipmentSlot.BODY) instead
  • com.mojang.blaze3d.platform.MemoryTracker
  • net.minecraft.server.level.ServerLevel#makeObsidianPlatform
  • net.minecraft.client.resources.model.ModelBakery$ModelGroupKey
Copy link

@ChampionAsh5357 Are there any changes related to data generation?

Take example of this code:

public final class ModEnchantmentTagsProvider extends EnchantmentTagsProvider {

	public ModEnchantmentTagsProvider(PackOutput packOutput, CompletableFuture<Provider> lookupProvider) {
		super(packOutput, lookupProvider);

	protected void addTags(Provider provider) {


    public String getName()
        return "Unique Magic Enchantment Tags";

It should add 4 new enchantments under existing Vanilla ARMOR_EXCLUSIVE tag.

The provider is registered normally in data generator:
dataGen.addProvider(event.includeServer(), new ModEnchantmentTagsProvider(packOutput, lookupProvider));

However, it cannot generate enchantment tag as it throws this error while running data generation:
Couldn't define tag minecraft:exclusive_set/armor as it is missing following references: uniquemagic:freezing_protection,uniquemagic:lightning_protection,uniquemagic:magic_protection,uniquemagic:sonic_protection

Although enchantments are working correctly, we have not been able to tag them with existing enchantment tag.

Are there any additional steps that must be taken to have this work properly?

Copy link

Are there any changes related to data generation?

In the way you're using it, no. The error suggests that you didn't generate the enchantments from your mod space. You might want to make sure you have enchantment datapack objects for your entries. Also, although the issue is caused by the enchantments move to datapacks, it is not any different from other datapack objects with tags.

I would suggest joining one of the many modding discord servers to ask for help since gist replies are very limited in capacity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment