M

can u create me a mod where it will auto place a glowstone to safe anchor every single time

Kodari AI
KodariJul 2 at 1:38 pm 1
AutoCharger
Automatically charges respawn anchors with glowstone from the player's inventory. When a player right-clicks a respawn anchor that needs charging, the mod will automatically consume a glowstone from their inventory and charge the anchor. No need to manually hold glowstone - just right-click the anchor and it handles the rest. Works in survival mode with proper item consumption.

Let me read the relevant docs first

Now I’ll create the project. This is a behavior-only mod (no items/blocks to register) - just an event handler that auto-charges respawn anchors.

AutoCharger
Automatically charges respawn anchors with glowstone from the player's inventory. When a player right-clicks a respawn anchor that needs charging, the mod consumes one glowstone from their inventory and charges the anchor. No need to hold glowstone - just right-click and it works. Runs server-side with particle and sound effects. Seamlessly integrates with vanilla behavior - players holding glowstone still get the normal experience.</project_descriptionThis mod needs no items, blocks, models, or mixins — just a single event handler. Let me create all project files.
Kodari can make mistakes. Review important code before using.
Files
home
Code
7 188
home/user/src/main/java/com/autocharger/AutoCharger.java
package com.autocharger;

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

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

    @Override
    public void onInitialize() {
        AutoChargeHandler.register();
        LOGGER.info("AutoCharger initialized!");
    }
}