I have an idea that will permit event handling in Minecraft. My idea is to add a command called listen. It syntax would be as follows:
/listen <target: target> <event: string> <data: int, string, x y z...> <command: command>
OR
/listen <position: x y z> <event: string> <data: dict> <command: command>
So, the listen command creates an event listener that focuses on an entity (syntax 1) or block (syntax 2) and runs a command when the entity does something or has something done to it. The event argument is the main idea as to what happens, and the data are a dictionary with more info for the event. The dictionary would be written in the format: info: value. Here is a table of different events and their required data for entities:
Event Description Arguments
Used An entity item: stringused an item
Destroyed an entity item: string
destroyed/
attacked
with an item
Jumped an entity jumped none
Sneaked a player sneaked none
landed an entity landed block: string
on a block
Note that writing 'any' means that the value could be anything. There are also different events for blocks, but some could be of the same name: like 'destroy' for blocks is different as only that block triggers the event.
I hope you like the idea.
Please sign in to leave a comment.
1 Comments