WILLIAM SU

For fabric 1.21.11

📎 1 file 1,489 chars
📄
pasted-code-1794892793344.txt
txt 1 lines
▶
Add spawners from DonutSMP, they look like normal spawners. All spawners in vanilla should no longer spawn mobs, and instead you can open them like a chest to access their storage, and when a double chest worth of loot is filled up, you can press a button to go to the next page. The spawner generates the loot that the mobs would've dropped, and you can take items out of the storage(but not put in), or press the drop button to drop a full page of items of the storage. The previous page and next page buttons should look like an arrow, and the drop button should look like a dropper. Those buttons take up the bottom row of slots in each page. Spawners can also be collected with silk touch pickaxe, and if you don't have silk touch it says in red text: "ѕɪʟᴋ ᴛᴏᴜᴄʜ ʀᴇǫᴜɪʀᴇᴅ". They can also stack, you do that by right clicking on a placed spawner while holding the same type of spawner in your hand, which adds one of the spawners in your hand onto the placed spawner. Shift right click adds all of the spawners in your hand. When you add spawners it says in red text: "You just added x spawners to the stack! There are now y spawners in the stack.", x is the amount you added, y is the new amount in the stack. The spawner gui should be titled "number spawnertype spawner(s)", ex: "5 Skeleton Spawners". The spawner items should have the epic rarity and titled: "Spawner", unitalicized, with item lore being yellow text representing the type of spawner, unitalicized, like: "Skeleton"
Kodari AI
KodariTue at 5:26 am 4
SpawnerStorageSystem
Transforms vanilla spawners into chest-like storage containers that no longer spawn mobs. Players open spawners to access paginated storage (double-chest capacity per page) where mob loot accumulates automatically. Features include silk-touch collection with red error message, stackable spawners via right-click or shift right-click, pagination arrows, and a dropper button to empty pages. GUI titled with stack count and spawner type, items have epic rarity with yellow type lore.

I’ll build the spawners around vanilla spawner blocks, with server-side loot storage and an owo-ui interface.

Created the Fabric 1.21.11 project and disabled vanilla spawner spawning.

Not yet implemented: loot generation and storage, the paged GUI, Silk Touch collection, stacking, and spawner item styling. The current spawning change also affects spawner minecarts, so this build isn’t ready for survival play.

Kodari can make mistakes. Review important code before using.
Files
src
build.gradle
gradle.properties
settings.gradle
Code
6 104
src/main/java/dev/kodari/spawnerstorage/mixin/MobSpawnerLogicMixin.java
package dev.kodari.spawnerstorage.mixin;

import net.minecraft.block.spawner.MobSpawnerLogic;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.BlockPos;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;

@Mixin(MobSpawnerLogic.class)
public abstract class MobSpawnerLogicMixin {
    @Inject(method = "serverTick", at = @At("HEAD"), cancellable = true)
    private void spawnerStorage$preventSpawns(ServerWorld world, BlockPos pos, CallbackInfo ci) {
        ci.cancel();
    }
}