Hey all, hope this is the right place to post and hope I do a good job of explaining my problem.
I want to write a plugin + datapack template that can do the following:
- The datapack detects an arbitrary event (in this example a player killing another player)
- The datapack records arbitrary JSON and stores it somewhere (in this example it could be something along the lines of
"event": "player_kill",
"killer": {
"name": "Steve",
"uuid": "…",
"health": 7.5,
"weapon": {
"id": "minecraft:diamond_sword",
"name": "Shiny"
}
},
"victim": {
"name": "Alex",
"uuid": "…"
}
}
- My plugin can detect where this JSON is stored, read it, and do what I need it to do. Obviously this Discord server is for datapacks and not plugins, I already know how to write Minecraft plugins so this part I am not too worried about. The requirements for the plugin though are that it's generic, and doesn't know any of the underlying events. The datapack could just as easily be replaced with one that detects when a player mines a diamond and sends a completely different JSON object to the plugin and the plugin doesn't need to be modified to take in this object.
I am basically wondering if the above is possible and what different strategies there are for constructing the JSON and storing it. Thanks in advance!!!