QωQ Library

QωQ Library

This is a mod for Fabric which add a simply way to subscribe and custom events!

by
418 Downloads
fabriclibrary
Rent Server with this Mod

Screenshots

QωQ Library

About this Mod

issues
forks
stars
license
QωQ Library
This is a library which can subscribe events simply.
It offers a way to Register Objects like items, the following example shows:

public static final Registration<Item> ITEMS = new Registration<>(Registry.ITEM, MOD_ID);
public static final Item EXAMPLE_ITEM = ITEMS.register("example_item", () -> new Item(new Item.Settings()));

Don't forget to add it into your Main Class:

@Override
public void onInitialize() {
  ItemInit.ITEMS.register();
}

If you want to Subscribe an event, do it like this:

@ModEvent
public class OnEventHandle {
    @SubscribeEvent
    public static void onEvent(IEvent event){
        //todo
    }
}

However, you must tell the program where did you put the class.
In this example, it just like this:

@Override
public void onInitialize() {
  ItemInit.ITEMS.register();
  EventLoader.initEvent("org.abstruck.qwq.init.event");
}

But, if you put your classes in std.init.event, it will be subscribed directly.
WARNING: DO NOT PUT CLASSES WITH @Mixin IN THIS FLODER!!!

Maybe sometimes you can't find an event you want in the library, you can custom a one:

public class AfterBreakEvent implements IEvent{
        private final World world;
        private final PlayerEntity player;
        private final BlockPos pos;
        private final BlockState state;
        private final BlockEntity blockEntity;
        private final ItemStack stack;
        public AfterBreakEvent(World world, PlayerEntity player, BlockPos pos, BlockState state, @Nullable BlockEntity blockEntity, ItemStack stack) {
            this.world = world;
            this.player = player;
            this.pos = pos;
            this.state = state;
            this.blockEntity = blockEntity;
            this.stack = stack;
        }

        public PlayerEntity getPlayer() {
            return player;
        }

        public BlockPos getPos() {
            return pos;
        }
        
        public BlockState getState(){
            reutrn state;
        }

        public World getWorld() {
            return world;
        }

        public BlockEntity getBlockEntity() {
            return blockEntity;
        }

        public ItemStack getStack() {
            return stack;
        }
    }

And don't forget to mixin:

@Mixin(Block.class)
public abstract class BlockMixin {
    @Inject(method = "afterBreak", at = @At("RETURN"))
    public void afterBreak(World world, PlayerEntity player, BlockPos pos, BlockState state, BlockEntity blockEntity, ItemStack stack, CallbackInfo ci){
        EventManager.onEventAction(() -> new AfterBreakEvent(world, player, pos, state, blockEntity, stack));
    }
}

Available Versions

QωQ Library 1.2release
MC 1.18.2fabric
January 27, 2023
QωQ Library 1.1release
MC 1.18.2fabric
January 25, 2023

How to Install QωQ Library on Your Server

1

Order Server

Order a Minecraft Java server with at least 3 GB RAM (4 GB recommended).

2

Set fabric Loader

In the panel under "Egg", select the fabric loader and matching Minecraft version (1.18.2).

3

Install Mod

Open the mod browser in the dashboard and search for "QωQ Library". Click "Install" – done! Alternatively, upload the .jar via SFTP to the /mods folder.

Compatibility

Mod Loaders

fabric

Minecraft Versions

1.18.2

Server-side

Required

Recommended RAM

4 GB(min. 3 GB)

Frequently Asked Questions

QωQ Library server crashes on startup – what to do?

Most common cause: wrong fabric version or insufficient RAM. Check the server log (latest.log) for "OutOfMemoryError" or "Mixin" errors. With Mado Hosting: ensure at least 3 GB RAM is allocated and the loader matches the mod version (1.18.2). You can switch loaders with one click in the panel.

Is QωQ Library compatible with fabric?

QωQ Library officially supports fabric for Minecraft 1.18.2. The Mado dashboard automatically detects incompatible loader combinations.

Server lagging with QωQ Library – how to optimize performance?

Recommended RAM: 4 GB (per 8 players). Use /spark profiler to check if QωQ Library consumes the most tick time. Common fixes: reduce server view-distance to 8-10, install "performant" or "starlight" as supplementary mods on Forge. With Mado Hosting, your server runs on NVMe SSDs with dedicated CPU cores for minimal latency.

Rent Modded Server

Install QωQ Library with just one click on your server.

Recommended RAM
4 GBab €8/mo
Min. 3 GB | +1 GB pro 8 Spieler
Create Server Now
1-Click Mod Install
NVMe SSD Storage
DDoS Protection included

Details

License
GNU General Public License v3.0 only
Server-side
Required

Supported Versions

1.18.2