Skip to content

Getting started

Stoppedwumm edited this page Feb 3, 2026 · 1 revision

Getting Started with ModPacks

This mod allows you to create fully functional Minecraft content (Items, Blocks, Scripts, and Textures) by simply dropping .zip files into a folder. No Java knowledge or compilation required!


1. Directory Setup

Once the mod is installed, look for a folder named modpacks in your main Minecraft directory (where mods and config are located).

If there is none, try starting Minecraft. It will autocreate it.

Every .zip file in this folder is treated as a separate mod.


2. The Core: pack.json

Every modpack ZIP must have a pack.json in the root. This defines your Mod ID and metadata.

File: pack.json

{
  "name": "Magic & Industry",
  "modid": "magicmod",
  "author": "YourName",
  "version": "1.0.0"
}

Note: Your modid must be lowercase and contain no spaces.


3. Creating Items & Blocks

Custom objects are defined using JSON files inside the mod/ folder of your ZIP.

Adding an Item

Path: mod/item/fire_wand.json

{
  "max_stack": 1,
  "rarity": "EPIC",
  "creative_tab": "main_tab"
}

Adding a Block

Path: mod/block/healing_station.json

{
  "hardness": 3.0,
  "resistance": 10.0,
  "light": 15,
  "ticks": true,
  "creative_tab": "main_tab"
}

Setting "ticks": true allows the block to run JavaScript code every second.


4. Programming with JavaScript

You can add logic to your items and blocks by creating .js files in mod/scripts/. The filename must match the ID of your item or block.

Item Logic (onRightClick)

Path: mod/scripts/fire_wand.js

function onRightClick(ctx) {
    if (ctx.isCrouching()) {
        ctx.actionBar("§6Fire Shield Activated!");
        ctx.addEffect("minecraft:fire_resistance", 600, 0);
    } else {
        ctx.explode(2.0, true);
        ctx.chat("§cFeel the heat!");
    }
}

Block Logic (onBlockTick)

Path: mod/scripts/healing_station.js

function onBlockTick(ctx) {
    // ctx.getEventData() returns the BlockPos for blocks
    var pos = ctx.getEventData();
    
    // Heal the player if they are nearby
    ctx.heal(1.0);
    ctx.spawnParticle("minecraft:heart", pos.getX() + 0.5, pos.getY() + 1.2, pos.getZ() + 0.5, 5, 0.3, 0.3, 0.3, 0.05);
}

Global Events (global.js)

Create a file named global.js to run code for every player or every block broken in the world.

Path: mod/scripts/global.js

function onPlayerTick(ctx) {
    if (ctx.isPlayerInRain()) {
        ctx.damage(0.5);
        ctx.actionBar("§9The rain is acidic!");
    }
}

function onBlockBreak(ctx) {
    var pos = ctx.getEventData();
    ctx.spawnParticle("minecraft:happy_villager", pos.getX(), pos.getY(), pos.getZ(), 10, 0.5, 0.5, 0.5, 0.1);
}

5. Adding Textures & Models (Resources)

To make your items look real, use the standard assets structure.

Texture Path

Place your .png at: assets/magicmod/textures/item/fire_wand.png

Model Path

Path: assets/magicmod/models/item/fire_wand.json

{
  "parent": "minecraft:item/generated",
  "textures": {
    "layer0": "magicmod:item/fire_wand"
  }
}

Language (Names)

Path: assets/magicmod/lang/en_us.json

{
  "item.magicmod.fire_wand": "Wand of Eternal Flame",
  "block.magicmod.healing_station": "Medical Bay",
  "itemGroup.magicmod.main_tab": "Magic & Industry Tab"
}

6. ZIP Checklist

Your final ZIP file should look like this:

my_mod.zip
├── pack.json
├── assets/
│   └── magicmod/
│       ├── lang/en_us.json
│       ├── models/item/fire_wand.json
│       └── textures/item/fire_wand.png
└── mod/
    ├── item/fire_wand.json
    ├── block/healing_station.json
    ├── tab/main_tab.json
    └── scripts/
        ├── global.js
        ├── fire_wand.js
        └── healing_station.js

7. Server & Multiplayer

  • Dedicated Servers: Put the same ZIP files in the server's modpacks folder.
  • Players: Every player must have the exact same ZIP files in their local modpacks folder to connect.
  • Scripts: The Server's scripts are the "Master." If a player changes their local script to give them infinite health, it won't work because the Server runs its own version of the code.

8. Common Script Functions (ctx)

  • ctx.chat(msg) - Send a message to the player.
  • ctx.actionBar(msg) - Show text above the hotbar.
  • ctx.heal(amount) - Heal (2.0 = 1 heart).
  • ctx.damage(amount) - Deal magic damage.
  • ctx.explode(power, fire) - Create an explosion at the player.
  • ctx.setBlock(x, y, z, id) - Change a block in the world.
  • ctx.giveItem(id, count) - Add item to inventory.
  • ctx.addEffect(id, duration, amp) - Give potion effect.
  • ctx.spawnParticle(id, x, y, z, count, ...) - Show particles.