penguimzy

Create an minecraft mod where you can see invisible players. It should toggle with j.

Kodari AI
KodariFeb 13 at 6:22 pm 7,422 (v2)

I’ll create a Minecraft Fabric mod that allows you to see invisible players with a toggle keybinding.

InvisiblePlayerViewer
A client-side Fabric mod that allows players to see invisible entities by toggling a special vision mode with the J key. When enabled, all invisible players and entities become visible with a subtle outline effect, making it useful for debugging, minigames, or administrative purposes. The toggle state persists across game sessions and displays a notification when activated or deactivated.

Now I’ll create the mod structure:

Invisible Viewer mod created! Press J to toggle seeing invisible players. The mod uses mixins to override invisibility checks on both Entity and LivingEntity classes, displaying an overlay message when toggled on/off.

penguimzy

Can you make it work with all entities

Kodari AI
KodariFeb 13 at 6:25 pm 10,143 (v2)

I’ll read the current implementation to understand how it works and then extend it to support all entities.

Looking at the current implementation, I can see it hooks Entity.isInvisible() and LivingEntity.isInvisibleTo(). To ensure it works with all entities (including non-living entities like armor stands, item frames, minecarts, etc.), I need to add the isInvisibleTo hook to the base Entity class as well.

Now I’ll update the EntityMixin to also hook isInvisibleTo(PlayerEntity) on the base Entity class. This ensures all entities work, not just LivingEntity subclasses.

Updated EntityMixin to hook both isInvisible() and isInvisibleTo(PlayerEntity) on the base Entity class, ensuring all entities (living and non-living like armor stands, item frames, minecarts, boats, items, etc.) become visible when the feature is enabled.

Kodari can make mistakes. Review important code before using.
Files
gradle
src
.gitignore
build.gradle
gradle.properties
settings.gradle
Code
12 260
src/main/java/com/invisviewer/InvisibleViewer.java
package com.invisviewer;

import net.fabricmc.api.ModInitializer;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class InvisibleViewer implements ModInitializer {
    public static final String MOD_ID = "invisviewer";
    public static final Logger LOGGER = LoggerFactory.getLogger(MOD_ID);

    @Override
    public void onInitialize() {
        LOGGER.info("Invisible Viewer initialized");
    }
}