Skip to content

Instantly share code, notes, and snippets.

View Timongcraft's full-sized avatar

Timon Seidel Timongcraft

  • Germany
  • 19:56 (UTC +01:00)
View GitHub Profile
@Machine-Maker
Machine-Maker / lifecycle-event-system.md
Last active January 9, 2024 21:42
Lifecycle Event System

Lifecycle Event System

Pull Request

What is this?

A new event system for plugins to register handlers for specific events that relate to the startup or reload of servers.

Why is this needed?

We already have an event system, why do we need another one? Fair question. The answer is in the lifecycle part of the name. Some of these events fire well before JavaPlugin instances are created, before the MinecraftServer instance is created, right at the very start of server startup, even before all the registries have been initialized which is like the 2nd thing to happen on a vanilla server. The existing Bukkit event system is not designed to exist at this time, and modifying it to support this environment is more trouble than just having a separate system for specific events that can fire during this early initialization.

@Mindgamesnl
Mindgamesnl / very nice.md
Last active August 18, 2023 14:52
Inventory holders, a quicky

Inventory holders can be used to register own types, handlers and data to a opened GUI for a player.

To start, we need to create our menu class that implemetns InventoryHolder and any other functions we may want. For this example, we are gonna fill the inventory and open it for player, then save the player for later ussage with our handler.

The menu

It will look something like this

import org.bukkit.Bukkit;
import org.bukkit.Material;
@qoomon
qoomon / conventional-commits-cheatsheet.md
Last active December 6, 2025 12:31
Conventional Commits Cheatsheet