Revision indexing in progress... (search in this revision will be accurate after indexed)
Enable build support by adding .onedev-buildspec.yml
schemas | Loading last commit info... | |
src | ||
README.md |
README.md
MinecraftEventHooks
Project metadata
Key | Value |
---|---|
Group ID | de.lwehmschulte |
Version | 0.0.1 |
Java Version | 21 |
Project Name | MinecraftEventHooks |
Event Json Examples
All events include a type and a server field. Player-related events include playerName and playerUuid. Example payloads:
Full schemas can be found under schemas
Chat Event
schema!!missing!!
{
"type": "chat_message",
"player": {"name": "Louis", "uuid": "aa819430-317a-440a-941e-ddddddd9"},
"messageTemplate": "{player}: {message}",
"message": "Louis: Hello world!",
"rawMessage": "Hello world!",
"server": "minecraft-server-0",
"timestamp": "2025-10-15T08:05:00Z"
}
Command Event
schema!!missing!!
{
"type": "command",
"player": {"name": "Louis", "uuid": "aa819430-317a-440a-941e-ddddddd9"},
"messageTemplate": "{player} executed /{command} {args}",
"message": "Louis executed /give @p diamond 1",
"command": "give",
"args": ["@p", "diamond", "1"],
"server": "minecraft-server-0",
"timestamp": "2025-10-15T08:10:00Z"
}
Join Event
schema!!missing!!
{
"type": "player_join",
"player": {"name": "Louis", "uuid": "aa819430-317a-440a-941e-ddddddd9"},
"messageTemplate": "{player} joined the game",
"message": "Louis joined the game",
"server": "minecraft-server-0",
"timestamp": "2025-10-15T08:00:00Z"
}
Leave Event
schema!!missing!!
{
"type": "player_leave",
"player": {"name": "Louis", "uuid": "aa819430-317a-440a-941e-ddddddd9"},
"messageTemplate": "{player} left the game",
"message": "Louis left the game",
"server": "minecraft-server-0",
"timestamp": "2025-10-15T08:30:00Z"
}
Death Event
schema!!missing!!
Player killed by another player
{
"type": "death",
"player": {"name": "Louis", "uuid": "aa819430-317a-440a-941e-ddddddd9"},
"killer": {"name": "Steve", "uuid": "bb819430-317a-440a-941e-aaaaaaa1"},
"messageTemplate": "{player} was slain by {killer}",
"message": "Louis was slain by Steve",
"server": "minecraft-server-0",
"timestamp": "2025-10-15T08:15:00Z"
}
Killed by an entity
{
"type": "death",
"player": {"name": "Louis", "uuid": "aa819430-317a-440a-941e-ddddddd9"},
"entity": {"type": "Creeper"},
"messageTemplate": "{player} was blown up by {entity}",
"message": "Louis was blown up by Creeper",
"server": "minecraft-server-0",
"timestamp": "2025-10-15T08:16:00Z"
}
Environmental / mixed death
{
"type": "death",
"player": {"name": "Louis", "uuid": "aa819430-317a-440a-941e-ddddddd9"},
"entity": {"type": "Skeleton"},
"messageTemplate": "{player} fell from a high place whilst trying to escape {entity}",
"message": "Louis fell from a high place whilst trying to escape Skeleton",
"server": "minecraft-server-0",
"timestamp": "2025-10-15T08:17:00Z"
}
Advancement Event
schema!!missing!!
{
"type": "advancement",
"player": {"name": "Louis", "uuid": "aa819430-317a-440a-941e-ddddddd9"},
"advancement": "minecraft:story/mine_diamond",
"messageTemplate": "{player} has made the advancement {advancement}",
"message": "Louis has made the advancement minecraft:story/mine_diamond",
"server": "minecraft-server-0",
"timestamp": "2025-10-15T08:20:00Z"
}
Dimension Change Event
schema!!missing!!
{
"type": "dimension_change",
"player": {"name": "Louis", "uuid": "aa819430-317a-440a-941e-ddddddd9"},
"from": "overworld",
"to": "the_nether",
"messageTemplate": "{player} traveled from {from} to {to}",
"message": "Louis traveled from overworld to the_nether",
"server": "minecraft-server-0",
"timestamp": "2025-10-15T08:27:00Z"
}
Server Start Event
schema!!missing!!
{
"type": "server_start",
"server": "minecraft-server-0",
"messageTemplate": "Server {server} has started",
"message": "Server minecraft-server-0 has started",
"timestamp": "2025-10-15T07:50:00Z"
}
Server Stop Event
schema!!missing!!
{
"type": "server_stop",
"server": "minecraft-server-0",
"messageTemplate": "Server {server} is stopping",
"message": "Server minecraft-server-0 is stopping",
"timestamp": "2025-10-15T09:00:00Z"
}
Config Example
schema!!missing!!
server_name: minecraft-server-0
webhooks:
- url: "https://example.com/webhook"
events:
player_join: true
player_leave: true
chat: true
command: true
death: true
advancement: true
dimension_change: true
- url: "https://analytics.example.com/webhook"
events:
player_join: true
player_leave: true
death: true
dimension_change: true
TODO
- Setup Gradle multi-module project using the folder structure above.
- Core module
- Implement HooksConfig to read hooks.yaml via Jackson YAML module.
- Implement EventAdapter to convert platform events into platform-agnostic events.
- Implement EventQueue with a thread-safe queue.
- Implement WebhookSender to consume queue and send asynchronous HTTP POST requests.
- Implement JSON payload formatting according to schemas above.
- Platform adapters
- Spigot: implement SpigotPlugin extending JavaPlugin. Register Bukkit listeners for chat, join, leave, death, advancement, dimension change, server start/stop, commands. Convert captured events to core events via EventAdapter.
- Fabric: implement FabricMod implementing ModInitializer. Register Fabric callbacks for the same events. Convert to core events via EventAdapter.
- Integrate queue
- Ensure event adapter enqueues events into the core EventQueue.
- HTTP Thread in core asynchronously consumes events and sends them to webhook.
- Test locally
- Run Spigot server with minecraft-events-spigot-0.0.1.jar.
- Run Fabric server with minecraft-events-fabric-0.0.1.jar.
- Verify events appear at your webhook.