sir reynolds

MAKE A SPIDERMAN MOD THAT USES THE "game.on" coding api

Kodari AI
KodariAug 29 at 10:59 pm 2
SpiderManWebSlinger
Adds Spider-Man themed gameplay to Minecraft Fabric 1.21.11. Players can craft and use web-shooter items that launch grappling webs to swing between surfaces, climb walls with web-crawling abilities, and shoot web projectiles to immobilize enemies. Includes a Spider-Man suit with enhanced jumping, fall damage immunity, and wall-climbing mechanics. Features custom particle effects for web strands, sound effects for web-shooting, and a stamina system to balance web usage. Integrates with the game.on coding API for seamless event handling and player interactions.

I’ll create a standalone Fabric 1.21.11 Spider-Man mod centered on a small game.on event API, with a web-shooter item, wall-climbing behavior, web-swinging-style movement hook, keybind, assets, and complete project metadata.

Created a standalone Fabric 1.21.11 Spider-Man mod with:

  1. game.on / game.emit event API.

  2. Craftable Web Shooter item.

  3. Web-swing impulse movement using raycast targets.

  4. Wall-climbing and reduced fall behavior while holding the Web Shooter.

  5. R keybind for shooting webs.

  6. Fabric 1.21.11 project setup, split client source set, metadata, recipe, language file, and item model definitions.

Crafting recipe: iron, string, redstone, and diamond.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
spider man mod
Code
16 451
src/main/java/com/kodari/spiderman/SpidermanMod.java
package com.kodari.spiderman;

import com.kodari.spiderman.api.GameEvents;
import com.kodari.spiderman.api.game;
import com.kodari.spiderman.item.ModItems;
import com.kodari.spiderman.power.SpiderPowers;
import net.fabricmc.api.ModInitializer;
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

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

    @Override
    public void onInitialize() {
        ModItems.initialize();

        game.on(GameEvents.PLAYER_TICK, (GameEvents.PlayerTick event) ->
                SpiderPowers.onPlayerTick(event.player()));
        game.on(GameEvents.WEB_SHOT, (GameEvents.WebShot event) ->
                SpiderPowers.onWebShot(event.player()));

        ServerTickEvents.END_SERVER_TICK.register(server ->
                server.getPlayerManager().getPlayerList().forEach(player ->
                        game.emit(GameEvents.PLAYER_TICK, new GameEvents.PlayerTick(player))));
    }
}