You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Instantly share code, notes, and snippets.
🍎
Eaten
apple502j
apple502j
🍎
Eaten
Contributing to Scratch, and sometimes finding an interesting (or boring) vulnerabilities.
they/them
The big chat refactor continues; this time, they introduced "signed command arguments". This is used by MessageArgumentType and TextArgumentType. The client parses the commands and signs each argument. (see ArgumentSignatures) This also means the packets for commands are now separate from the chat message packet. (see CommandExecutionC2SPacket) Note that you can still use ClientPlayerEntity#sendChatMessage(String) with /-prefixed string to execute commands.
Now that Mojang has decided to refactor chat, it'll be a good time to add an API for that. I had some designs (including one made in 1.18 that I put on GitHub), however I think there are better changes.
Note on Compatibility
I expect the new API to be 1.19+ exclusive, however it's not impossible to backport most (if not all). One of the biggest 17a changes was that chat messages are no longer "wrapped" in chat.type.text and sender/message info were completely split. In 1.18 depending on the injection point it required us to "parse" the text to get the original message, however with this change it is no longer necessary.
Game can crash while ticking some mobs (parrots, allays, etc). MC-250321
Changes
Loader/Loom update required
Minecraft now uses LWJGL version 3.3.1, which contains Java 19-compiled class files. While you do not need Java 19 to play or build mods, this means Fabric Loader needs to be updated to version 0.14.0 (currently beta), and the same goes to Loom (refresh dependencies). The new Fabric Loader also contains some new features and improvements; the most significant one being ability to mixin into libraries like authlib.
Big Text refactor
Texts were split into text contents and structures. "Text contents" include what was previously called LiteralText, TranslatableText, etc (which no longer subclass or implement Text), and "text structure" is Text/MutableText (now a class with implementation). Text contents implement class_7417/TextContent. Various NBT text implementations have now been changed to "data so
Game can randomly crash due to atomic operation failure. (MC-249933)
You cannot launch the game without authenticating/in offline mode; add --uuid=123 run arg to fix.
Changes
Random replaced with AbstractRandom
java.util.Random has been replaced with AbstractRandom in most of the code. This interface, previously under net.minecraft.world.gen.random package and now under net.minecraft.util.math.random, provides most of the operations Random supports. There are 3 vanilla implementations based on Java Random:
Please contact apple502j for any corrections, suggestions etc! (available on Fabricord https://fabricmc.net/discuss/)
TLDR
Mods will be broken, especially if it adds new contents.
Major Changes
Registry modification/adding custom content to registry now requires Fabric API due to the addition of "frozen registry". Either add Fabric API or fabric-registry-sync-v0 as an dependency.
Tags and Registries Update. Tag is gone and you need TagKey. However, if you're just using isOf call with a vanilla tag, there should be no refactor. To understand TagKey and other new classes, I've prepared a separate TLDR document.
Several Fabric API modules removed, mostly deprecated ones. This includes Tag Extension API which has a separate migration guide. Unless you are using tag replacement stuff, vanilla code should be used.
Tag Extension API for Fabric has been removed in 1.18.2. Here are some vanilla replacements:
FabricDataGeneratorTagBuilder
Vanilla ObjectBuilder contains addOptional (corresponding to addOptionalObject in FAPI) and addOptionalTag. They both return the builder itself, unlike FAPI provided ones that do not have return values. The arguments are the same, all taking one Identifier.
TagFactory
There is a generic method TagKey#of which can be used to create TagKey for any registries (blocks, items, biomes, villager professions, custom registry items, etc). You can also use BlockTags#register, etc provided you use accessor or access widener to make it public.
One thing to note is that Tag.Identified has become TagKey. TagKey, like RegistryKey, does not hold the value(s) itself - you have to query the values from the registry. For example, Registry.BLOCK.iterateEntries(tagKey) will return an iterable of RegistryEntry. The following code in 1.18.1:
RegistryEntryList is a list of RegistryEntry, supports directly referencing items and referencing using tags
Registries are frozen unless you use Fabric API: to add custom entries to a registry, you need to add Fabric API as an dependency!
Instances of Block/Item/etc must be ALWAYS registered otherwise it'll crash.
TagKey
TagKey, like RegistryKey, is a key/identifier for a tag. Many methods that took Tag will now take TagKey instead, such as BlockState#isIn. Built-in TagKeys are still available in BlockTags class, etc.