This mod adds magical Lanterns to Minecraft.
Players can find Souls inside small cave structures in the Overworld. These structures contain a Soul Ore block in the center, surrounded by Hard Stone. Hard Stone and Soul Ore can only be mined with a Strong Iron Pickaxe.
To obtain one, players must use a new Forge Table, where they can sacrifice XP and Iron to create Magic Iron. Magic Iron is then used to craft the Strong Iron Pickaxe.
Soul Ore drops one random Soul:
- Soul of Health
- Soul of Crimson
- Soul of Blood
- Soul of Faith
Using the Forge Table, players can craft a Lantern with 8 Magic Iron (or Magic Gold) and a Soul.
Lantern effects (active while held in the off-hand):
- Health Lantern: Grants extra health and better regeneration
- Crimson Lantern: Increases mining speed and gives a chance to duplicate naturally generated block drops (not player-placed blocks).
- Blood Lantern: Grants healing, XP, and speed when killing mobs, but slowly damages the player while equipped.
- Faith Lantern: Reduces all incoming damage by 50%, but prevents the player from attacking mobs.
Let me read the necessary docs before writing a single line of code.
Here’s the full plan before I write a single file:
Blocks:
HardStoneBlock,SoulOreBlock,ForgeTableBlock+ForgeTableBlockEntityItems:
MagicIron,MagicGold,StrongIronPickaxeItem, 4SoulItems, 4LanternItems (withLanternTypeenum)Screen:
ForgeTableScreenHandler(3-slot: material, soul, output) + clientForgeTableScreenMixins:
PlayerEntityMixin(lantern off-hand tick + Faith damage halving),BlockItemMixin(placement tracking for Crimson)Worldgen:
SoulCaveFeature(3×3×3 HardStone shell + SoulOre center), programmatic biome modificationEvents: Off-hand kill detection (Blood), attack prevention (Faith), block break drops (Crimson)
Now all the data/resource files:
Now the mandatory items/ definition files (1.21.4+ requirement):
Now the data files — loot tables, recipes, tags, worldgen:
What was built:
System | Details |
|---|---|
Blocks | HardStoneBlock, SoulOreBlock (hardness 6, blast resistance 1200), ForgeTableBlock (BlockWithEntity, opens screen on right-click, scatters items on break) |
ForgeTable GUI | 3-slot screen handler (material · soul · output). Server computes output live; output slot checks XP before allowing pickup. XP cost shown in green text (2 levels for forging, 5 for lanterns). Client uses crafting table texture as placeholder |
LanternItem effects | Applied in PlayerEntityMixin off-hand tick — Health (Health Boost II + Regen I), Crimson (Haste II), Blood (drain 1 HP every 4 s), Faith (mixin halves all incoming damage via re-entrant flag) |
Events | Crimson 25% drop duplication with player-placement tracking ( BlockItemMixin), Blood +3 HP +8 XP on kill, Faith prevents attacking via AttackEntityCallback.FAIL |
StrongIronPickaxe | Extends PickaxeItem(ToolMaterial.IRON), overrides isSuitableFor + getMiningSpeedMultiplier (9.0f) for #soullanterns:needs_strong_iron_tool blocks. All blocks in minecraft:needs_diamond_tool so iron can’t mine them for drops. Loot tables require match_tool: strong_iron_pickaxe for ore/hard stone drops |
WorldGen | SoulCaveFeature places 3×3×3 Hard Stone shell + Soul Ore center in BASE_STONE_OVERWORLD. Registered to overworld underground ores layer via BiomeModifications.addFeature |
Textures needed: Add 16×16 PNGs to
assets/soullanterns/textures/block/(hard_stone,soul_ore,forge_table_top,forge_table_front,forge_table_side) andassets/soullanterns/textures/item/for all 11 items. Until then items show the missing-texture checker.
The compilation failed with this error:
Compilation failed with 28 error(s):
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 7: cannot find symbol
import net.minecraft.item.PickaxeItem;
^
symbol: class PickaxeItem
location: package net.minecraft.item
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 13: cannot find symbol
public class StrongIronPickaxeItem extends PickaxeItem {
^
symbol: class PickaxeItem
ERROR in src/main/java/com/example/soullanterns/block/ForgeTableBlock.java at line 9: cannot find symbol
import net.minecraft.item.ItemScatterer;
^
symbol: class ItemScatterer
location: package net.minecraft.item
ERROR in src/main/java/com/example/soullanterns/ModScreenHandlers.java at line 4: cannot find symbol
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
^
symbol: class ScreenHandlerRegistry
location: package net.fabricmc.fabric.api.screenhandler.v1
ERROR in src/main/java/com/example/soullanterns/ModEvents.java at line 62: incompatible types: incompatible parameter types in lambda expression
ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY.register((world, attacker, killed) -> {
^
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 22: method does not override or implement a method from a supertype
@Override
^
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 24: cannot find symbol
return super.isSuitableFor(state) || state.isIn(NEEDS_STRONG_IRON);
^
symbol: variable super
location: class StrongIronPickaxeItem
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 27: method does not override or implement a method from a supertype
@Override
^
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 30: cannot find symbol
return super.getMiningSpeedMultiplier(stack, state);
^
symbol: variable super
location: class StrongIronPickaxeItem
ERROR in src/main/java/com/example/soullanterns/ModItems.java at line 25: incompatible types: bad return type in method reference
StrongIronPickaxeItem::new,
^
ERROR in src/main/java/com/example/soullanterns/block/ForgeTableBlock.java at line 51: cannot find symbol
ItemScatterer.scatter(world, pos, forgeBE);
^
symbol: variable ItemScatterer
location: class ForgeTableBlock
ERROR in src/main/java/com/example/soullanterns/block/entity/ForgeTableBlockEntity.java at line 90: cannot find symbol
return BlockEntity.canPlayerUse(this, player);
^
symbol: method canPlayerUse(ForgeTableBlockEntity,PlayerEntity)
location: class BlockEntity
ERROR in src/main/java/com/example/soullanterns/ModScreenHandlers.java at line 11: cannot find symbol
ScreenHandlerRegistry.registerSimple(
^
symbol: variable ScreenHandlerRegistry
location: class ModScreenHandlers
ERROR in src/main/java/client/java/com/example/soullanterns/client/screen/ForgeTableScreen.java at line 29: no suitable method found for drawTexture(Identifier,int,int,int,int,int,int)
context.drawTexture(TEXTURE, x, y, 0, 0, this.backgroundWidth, this.backgroundHeight);
^
ERROR in src/main/java/client/java/com/example/soullanterns/client/screen/ForgeTableScreen.java at line 29: no suitable method found for drawTexture(Identifier,int,int,int,int,int,int)
context.drawTexture(TEXTURE, x, y, 0, 0, this.backgroundWidth, this.backgroundHeight);
^
ERROR in src/main/java/com/example/soullanterns/ModEvents.java at line 62: incompatible types: incompatible parameter types in lambda expression
ServerEntityCombatEvents.AFTER_KILLED_OTHER_ENTITY.register((world, attacker, killed) -> {
^
ERROR in src/main/java/com/example/soullanterns/ModItems.java at line 25: incompatible types: bad return type in method reference
StrongIronPickaxeItem::new,
^
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 7: cannot find symbol
import net.minecraft.item.PickaxeItem;
^
symbol: class PickaxeItem
location: package net.minecraft.item
ERROR in src/main/java/com/example/soullanterns/block/ForgeTableBlock.java at line 9: cannot find symbol
import net.minecraft.item.ItemScatterer;
^
symbol: class ItemScatterer
location: package net.minecraft.item
ERROR in src/main/java/com/example/soullanterns/ModScreenHandlers.java at line 4: cannot find symbol
import net.fabricmc.fabric.api.screenhandler.v1.ScreenHandlerRegistry;
^
symbol: class ScreenHandlerRegistry
location: package net.fabricmc.fabric.api.screenhandler.v1
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 24: cannot find symbol
return super.isSuitableFor(state) || state.isIn(NEEDS_STRONG_IRON);
^
symbol: variable super
location: class StrongIronPickaxeItem
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 30: cannot find symbol
return super.getMiningSpeedMultiplier(stack, state);
^
symbol: variable super
location: class StrongIronPickaxeItem
ERROR in src/main/java/com/example/soullanterns/block/ForgeTableBlock.java at line 51: cannot find symbol
ItemScatterer.scatter(world, pos, forgeBE);
^
symbol: variable ItemScatterer
location: class ForgeTableBlock
ERROR in src/main/java/com/example/soullanterns/ModScreenHandlers.java at line 11: cannot find symbol
ScreenHandlerRegistry.registerSimple(
^
symbol: variable ScreenHandlerRegistry
location: class ModScreenHandlers
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 22: method does not override or implement a method from a supertype
@Override
^
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 27: method does not override or implement a method from a supertype
@Override
^
ERROR in src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java at line 13: cannot find symbol
public class StrongIronPickaxeItem extends PickaxeItem {
^
symbol: class PickaxeItem
ERROR in src/main/java/com/example/soullanterns/block/entity/ForgeTableBlockEntity.java at line 90: cannot find symbol
return BlockEntity.canPlayerUse(this, player);
^
symbol: method canPlayerUse(ForgeTableBlockEntity,PlayerEntity)
location: class BlockEntity
=== COMPILATION ERROR ANALYSIS ===
MISSING CLASSES:
- PickaxeItem
- ItemScatterer
- ScreenHandlerRegistry
ACTION: Create these classes or check imports
MISSING METHODS:
- canPlayerUse(ForgeTableBlockEntity,PlayerEntity)
ACTION: Check method names and signatures
TYPE MISMATCHES:
- incompatible types: incompatible parameter types in lambda expression
- incompatible types: bad return type in method reference
- incompatible types: incompatible parameter types in lambda expression
- incompatible types: bad return type in method reference
ACTION: Fix variable types or casting
FILES TO INVESTIGATE:
- src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java
- src/main/java/com/example/soullanterns/block/ForgeTableBlock.java
- src/main/java/com/example/soullanterns/ModScreenHandlers.java
- src/main/java/com/example/soullanterns/ModEvents.java
- src/main/java/com/example/soullanterns/ModItems.java
- src/main/java/com/example/soullanterns/block/entity/ForgeTableBlockEntity.java
- src/main/java/client/java/com/example/soullanterns/client/screen/ForgeTableScreen.java
- src/main/java/client/java/com/example/soullanterns/client/screen/ForgeTableScreen.java
- src/main/java/com/example/soullanterns/ModEvents.java
- src/main/java/com/example/soullanterns/ModItems.java
- src/main/java/com/example/soullanterns/item/StrongIronPickaxeItem.java
- src/main/java/com/example/soullanterns/block/ForgeTableBlock.java
- src/main/java/com/example/soullanterns/ModScreenHandlers.java
- src/main/java/com/example/soullanterns/block/entity/ForgeTableBlockEntity.java
Please fix this error by creating a new artifact with the corrected code.
package com.example.soullanterns;
import com.example.soullanterns.client.screen.ForgeTableScreen;
import net.fabricmc.api.ClientModInitializer;
import net.minecraft.client.gui.screen.ingame.HandledScreens;
public class SoulLanternsClient implements ClientModInitializer {
@Override
public void onInitializeClient() {
HandledScreens.register(ModScreenHandlers.FORGE_TABLE, ForgeTableScreen::new);
}
}