Loading...
Beta Modpages Unclaimed

Modifier Tooltip Fix (Fabric)

Fixes incorrect equality checking in the modifier tooltip code

0 Likes
3865 Downloads
Created by Daomephsta

Description

The special equals style of attribute modifier tooltip used for attack damage & attack speed is not available when attribute modifiers are added via NBT (e.g. JSON recipes).
This mod changes that.

Example

The following command gives an Iron Sword with its default modifiers overridden by identical modifiers via NBT.

give @p minecraft:iron_sword{AttributeModifiers:[{Slot:"mainhand", AttributeName:"generic.attack_damage", Name:"generic.attack_damage", Amount:5, Operation:0, UUID: [I;-885041709, 1683771192, -1533567981, -1556236849]},{Slot:"mainhand", AttributeName:"generic.attack_speed", Name:"generic.attack_speed", Amount:-2.4, Operation:0,UUID: [I;-98353636, 1098926181, -1340359474, -1752847197]}]}
The tooltip without this mod installed

The tooltip with this mod installed

 

Affected UUIDs

Attribute Name

UUID

generic.attack_damage   

CB3F55D3-645C-4F38-A497-9C13A33DB5CF
[I;-885041709, 1683771192, -1533567981, -1556236849]

generic.attack_speed

FA233E1C-4180-4865-B01B-BCCE9785ACA3
[I;-98353636, 1098926181, -1340359474, -1752847197]

 

When one of the UUIDs listed above is used by a modifier for the corresponding attribute, an equals style tooltip will be used. These UUIDs are the UUIDs used by the default modifiers, but a quirk of the vanilla code prevents the equals style being used for modifiers loaded from NBT. Mojang doesn’t seem to consider it a bug, but it bothered me, so I made a fix.

Note to Mod Devs

If you wish to include this fix in your own mod, you MUST use Loom’s include configuration to package this mod within your JAR. The mixin used in this mod cannot coexist with other copies of itself. I lack the resources to host a Maven, so I suggest you use JitPack.

Compatible Minecraft Versions

Modifier Tooltip Fix builds are marked with the Minecraft version they were built for, they will work for that version. However since Modifier Tooltip Fix consists only of 2 simple mixins, it is highly likely that a build is compatible with future versions of Minecraft. If the latest Modifier Tooltip Fix build does not work for the latest snapshot or release, leave a comment on this project and I will update it.

 


AD Become Premium to remove Ads!

What means Verified?

  • Compatibility: The mod should be compatible with the latest version of Minecraft and be clearly labeled with its supported versions.
  • Functionality: The mod should work as advertised and not cause any game-breaking bugs or crashes.
  • Security: The mod should not contain any malicious code or attempts to steal personal information.
  • Performance: The mod should not cause a significant decrease in the game's performance, such as by causing lag or reducing frame rates.
  • Originality: The mod should be original and not a copy of someone else's work.
  • Up-to-date: The mod should be regularly updated to fix bugs, improve performance, and maintain compatibility with the latest version of Minecraft.
  • Support: The mod should have an active developer who provides support and troubleshooting assistance to users.
  • License: The mod should be released under a clear and open source license that allows others to use, modify, and redistribute the code.
  • Documentation: The mod should come with clear and detailed documentation on how to install and use it.

AD Become Premium to remove Ads!

How to Install

1

Download Forge & Java

Download Forge from the offical Site or here. If you dont have Java installed then install it now from here. After Downloading Forge you can run the file with Java.

2

Prepare

Lounch Minecraft and select your Forge istallation as Version this will create a Folder called Mods.

3

Add Mods

Type Win+R and type %appdata% and open the .minecraft Folder. There will you find your Folder called Mods. Place all Mods you want to play in this Folder

4

Enjoy

You are now Ready. Re-start your Game and start Playing.

More Mods like this

Quark

A Quark is a very small thing. This mod is a collection of small things that improve the vanilla minecraft experience.

Chisel

A builder's best friend.

Better Advancements

Successor to BetterAchievements for the new advancements system in minecraft 1.12+

Cosmetic Armor Reworked

This mod allows you to wear two sets of armor, one for display, one for function.

Macaw's Doors

Adds vanila doors with every wood color and new unique doors!

MalisisDoors

New animations for doors. You can build you own doors with millions of possibilities!

Macaw's Roofs

Build roofs with actual roofs instead of stairs!