Skip to content

[Mixin] @Desc does not allow matching field instructions #2623

Description

@Piggered

Minecraft Development for IntelliJ plugin version

2026.1-1.8.17

IntelliJ version

IntelliJ IDEA 2026.1.3

Operating System

Linux

Target platform

Fabric, Mixins

Description of the bug

In Fabric's fork of Mixin, the @Desc annotation allows matching for field instructions (see FabricMC/Mixin#160). The plugin doesn't recognize this and does not resolve fields for @Desc values.

Example code:

@Mixin(Creeper.class)
@Desc(id = "swell", value = "swell", ret = int.class)
public class CreeperMixin
{
    @Redirect(method = "causeFallDamage", at = @At(value = "FIELD", target = "@Desc(swell)", opcode = Opcodes.PUTFIELD))
    private void causeFallDamage(Creeper creeper, int swell)
    {
        if (Minecraft.getInstance().player == null)
        {
            return;
        }

        Minecraft.getInstance().schedule(() -> 
            Minecraft.getInstance().player.sendSystemMessage(
                Component.literal("[")
                    .append(creeper.getStringUUID())
                    .append("] swell: ")
                    .append(String.valueOf(swell))
        ));
    }
}

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions