Mod

QωQ Library

Quick rating

QωQ Library

No reviews yet

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

API/Library
Mod Loaders
Fabric
Minecraft

Community voices

Reviews

Versions
Loading versions…
Match includes

Click once to include, again to exclude, again to clear

Rating Any
Any 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0 4.5 5.0
Min
Max
Play Status
Reviews
Time Played
hrs+
Verified developers only
Has developer response
List view
Grid view
Compact view
Sort by
Date
Rating
Helpful
Unhelpful
Edited
Sort ascending
Delete this review?

This removes your review from the project. You can write a new review after.

Review submitted for moderation

Your review has been sent to moderators, who will check that it meets our guidelines before it appears publicly.

No reviews yet. Be the first to review this project!

Get it on

Available Platforms

Compatibility

Supported Environments

Dev Environment
Client Required
Server Required

About

Project Details

Type
Mod
License
GNU General Public License v3.0 only
Latest Version
1.2
Authors

For authors

Embed Badge

If you're the author of this project, you can embed a live badge anywhere that supports HTML or Markdown. It updates automatically whenever ratings change.

Custom banner text
ModDex rating badge preview

Use HTML for any page that supports it, or Markdown for README files and Markdown-based descriptions.

Identifiers

Platform IDs

Modrinth ID

Resources

External Links

Source Issues Wiki Discord

About

Description

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));
    }
}

Screenshots

Gallery

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

Versions

Files

Relations

Project Relations

More like this

Similar Mods

Suggestions use data such as tags, dependencies, dependents, descriptions, titles, and more to rank how much they overlap with this mod.

On ModDex

Community snapshot

0
Ratings
0
Followers
0
In stacks

By the numbers

Statistics

<1,000
Downloads
Last Updated
CurseForge
Created
Last synced
When ModDex last fetched and imported data for this project from CurseForge or Modrinth. High-traffic and active projects are checked more often.
Next pipeline sync