diff --git a/source/behavior/entities/format/components/ageable.json b/source/behavior/entities/format/components/ageable.json index 85c4e645..79c9f541 100644 --- a/source/behavior/entities/format/components/ageable.json +++ b/source/behavior/entities/format/components/ageable.json @@ -58,7 +58,7 @@ "title": "Feed Items" }, "grow_up": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to run when this entity grows up.", "title": "Grow Up" }, diff --git a/source/behavior/entities/format/components/angry.json b/source/behavior/entities/format/components/angry.json index dba5067a..7ccc671a 100644 --- a/source/behavior/entities/format/components/angry.json +++ b/source/behavior/entities/format/components/angry.json @@ -40,7 +40,7 @@ }, "calm_event": { "title": "Calm Event", - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to run after the number of seconds specified in duration expires (when the entity stops being \"angry\")" }, "angry_sound": { diff --git a/source/behavior/entities/format/components/breedable.json b/source/behavior/entities/format/components/breedable.json index 028e8783..c279e7b4 100644 --- a/source/behavior/entities/format/components/breedable.json +++ b/source/behavior/entities/format/components/breedable.json @@ -16,7 +16,7 @@ "title": "Baby Type" }, "breed_event": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to run when this entity breeds.", "title": "Breed Event" }, diff --git a/source/behavior/entities/format/components/drying_out_timer.json b/source/behavior/entities/format/components/drying_out_timer.json index 6a4535eb..083542db 100644 --- a/source/behavior/entities/format/components/drying_out_timer.json +++ b/source/behavior/entities/format/components/drying_out_timer.json @@ -6,17 +6,17 @@ "additionalProperties": false, "properties": { "dried_out_event": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to fire when the drying out time runs out.", "title": "Dried Out Event" }, "recover_after_dried_out_event": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to fire when entity was already dried out but received increase in water supply.", "title": "Recover After Dried Out Event" }, "stopped_drying_out_event": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to fire when entity stopped drying out, for example got into water or under rain.", "title": "Stopped Drying Out Event" }, diff --git a/source/behavior/entities/format/components/equippable.json b/source/behavior/entities/format/components/equippable.json index cce002e6..7f705c6c 100644 --- a/source/behavior/entities/format/components/equippable.json +++ b/source/behavior/entities/format/components/equippable.json @@ -42,12 +42,12 @@ "title": "Interact Text" }, "on_equip": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to trigger when this entity is equipped with this item.", "title": "On Equip" }, "on_unequip": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to trigger when this item is removed from this entity.", "title": "On Unequip" } diff --git a/source/behavior/entities/format/components/genetics.json b/source/behavior/entities/format/components/genetics.json index 23fca464..2ff30149 100644 --- a/source/behavior/entities/format/components/genetics.json +++ b/source/behavior/entities/format/components/genetics.json @@ -70,7 +70,7 @@ "type": "object", "properties": { "birth_event": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to run when this mob is created and matches the above allele conditions.", "title": "Brith Event" }, diff --git a/source/behavior/entities/format/components/giveable.json b/source/behavior/entities/format/components/giveable.json index bb54fadd..6f8f51d0 100644 --- a/source/behavior/entities/format/components/giveable.json +++ b/source/behavior/entities/format/components/giveable.json @@ -28,7 +28,7 @@ } }, "on_give": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to fire when the correct item is given.", "title": "On Give" } diff --git a/source/behavior/entities/format/components/inside_block_notifier.json b/source/behavior/entities/format/components/inside_block_notifier.json index 7a526083..26d1f82b 100644 --- a/source/behavior/entities/format/components/inside_block_notifier.json +++ b/source/behavior/entities/format/components/inside_block_notifier.json @@ -23,13 +23,13 @@ "title": "Entered Block Event", "description": "Event to run when this mob enters a valid block.", "$comment": "UNDOCUMENTED", - "$ref": "../types/event.json" + "$ref": "../types/event_object.json" }, "exited_block_event": { "title": "Exited Block Event", "description": "Event to run when this mob leaves a valid block.", "$comment": "UNDOCUMENTED", - "$ref": "../types/event.json" + "$ref": "../types/event_object.json" } } } diff --git a/source/behavior/entities/format/components/leashable.json b/source/behavior/entities/format/components/leashable.json index 9298ff18..bd8b99f0 100644 --- a/source/behavior/entities/format/components/leashable.json +++ b/source/behavior/entities/format/components/leashable.json @@ -24,12 +24,12 @@ "title": "Maximum Distance" }, "on_leash": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when this entity is leashed.", "title": "On Leash" }, "on_unleash": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when this entity is unleashed.", "title": "On Unleash" }, diff --git a/source/behavior/entities/format/components/lookat.json b/source/behavior/entities/format/components/lookat.json index e13d937c..4357b6be 100644 --- a/source/behavior/entities/format/components/lookat.json +++ b/source/behavior/entities/format/components/lookat.json @@ -25,7 +25,7 @@ "look_event": { "description": "The event identifier to run when the entities specified in filters look at this entity.", "title": "Look Event", - "$ref": "../types/event.json" + "$ref": "../types/event_object.json" }, "search_radius": { "type": "number", diff --git a/source/behavior/entities/format/components/nameable.json b/source/behavior/entities/format/components/nameable.json index b295a75e..762818ff 100644 --- a/source/behavior/entities/format/components/nameable.json +++ b/source/behavior/entities/format/components/nameable.json @@ -18,7 +18,7 @@ "title": "Name Filter" }, "on_named": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to be called when this entity acquires the name specified in `name_filter'.", "title": "On Named" } diff --git a/source/behavior/entities/format/components/peek.json b/source/behavior/entities/format/components/peek.json index 71bb60e9..66eaf239 100644 --- a/source/behavior/entities/format/components/peek.json +++ b/source/behavior/entities/format/components/peek.json @@ -7,17 +7,17 @@ "required": [], "properties": { "on_close": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when the entity is done peeking.", "title": "On Close" }, "on_open": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when the entity starts peeking.", "title": "On Open" }, "on_target_open": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when the entity's target entity starts peeking.", "title": "On Target Open" } diff --git a/source/behavior/entities/format/components/rail_sensor.json b/source/behavior/entities/format/components/rail_sensor.json index e88ccc00..16406ef6 100644 --- a/source/behavior/entities/format/components/rail_sensor.json +++ b/source/behavior/entities/format/components/rail_sensor.json @@ -25,12 +25,12 @@ "title": "Eject On Deactivate" }, "on_activate": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when the rail is activated.", "title": "On Activate" }, "on_deactivate": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when the rail is deactivated.", "title": "On Deactivate" }, diff --git a/source/behavior/entities/format/components/sittable.json b/source/behavior/entities/format/components/sittable.json index ee97bff2..61529e87 100644 --- a/source/behavior/entities/format/components/sittable.json +++ b/source/behavior/entities/format/components/sittable.json @@ -7,12 +7,12 @@ "required": [], "properties": { "sit_event": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to run when the entity enters the `sit` state.", "title": "Sit Event" }, "stand_event": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to run when the entity exits the `sit` state.", "title": "Stand Event" } diff --git a/source/behavior/entities/format/components/tameable.json b/source/behavior/entities/format/components/tameable.json index dcdf9b83..7fe72817 100644 --- a/source/behavior/entities/format/components/tameable.json +++ b/source/behavior/entities/format/components/tameable.json @@ -16,7 +16,7 @@ }, "tame_event": { "title": "Tame Event", - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to run when this entity becomes tamed." }, "tame_items": { diff --git a/source/behavior/entities/format/components/tamemount.json b/source/behavior/entities/format/components/tamemount.json index cc827506..43fa3f23 100644 --- a/source/behavior/entities/format/components/tamemount.json +++ b/source/behavior/entities/format/components/tamemount.json @@ -95,7 +95,7 @@ "title": "Ride Text" }, "tame_event": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event that triggers when the entity becomes tamed.", "title": "Tame Event" } diff --git a/source/behavior/entities/format/components/target_nearby_sensor.json b/source/behavior/entities/format/components/target_nearby_sensor.json index 08de749c..238025e1 100644 --- a/source/behavior/entities/format/components/target_nearby_sensor.json +++ b/source/behavior/entities/format/components/target_nearby_sensor.json @@ -19,17 +19,17 @@ "title": "Inside Range" }, "on_inside_range": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when an entity gets in the inside range. Can specify `event` for the name of the event and `target` for the target of the event", "title": "On Inside Range" }, "on_outside_range": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when an entity gets in the outside range. Can specify `event` for the name of the event and `target` for the target of the event", "title": "On Outside Range" }, "on_vision_lost_inside_range": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to call when an entity exits visual range. Can specify `event` for the name of the event and `target` for the target of the event", "title": "On Vision Lost Inside Range" }, diff --git a/source/behavior/entities/format/components/timer.json b/source/behavior/entities/format/components/timer.json index 89563bee..c2465d8d 100644 --- a/source/behavior/entities/format/components/timer.json +++ b/source/behavior/entities/format/components/timer.json @@ -37,7 +37,7 @@ "time_down_event": { "description": "Event to fire when the time on the timer runs out.", "title": "Time Down Event", - "$ref": "../types/event.json" + "$ref": "../types/event_object.json" }, "random_time_choices": { "type": "array", diff --git a/source/behavior/entities/format/components/trusting.json b/source/behavior/entities/format/components/trusting.json index 729ef59a..7844878f 100644 --- a/source/behavior/entities/format/components/trusting.json +++ b/source/behavior/entities/format/components/trusting.json @@ -13,7 +13,7 @@ "title": "Probability" }, "trust_event": { - "$ref": "../types/event.json", + "$ref": "../types/event_object.json", "description": "Event to run when this entity becomes trusting.", "title": "Trust Event" }, diff --git a/source/behavior/entities/format/types/event_object.json b/source/behavior/entities/format/types/event_object.json new file mode 100644 index 00000000..6319f886 --- /dev/null +++ b/source/behavior/entities/format/types/event_object.json @@ -0,0 +1,17 @@ +{ + "$id": "blockception.minecraft.entities.event_object", + "title": "Event", + "description": "Minecraft behavior event.", + "examples": [{ "event": "example:foo", "target": "self" }], + "type": "object", + "additionalProperties": false, + "properties": { + "event": { "type": "string", "pattern": "^[a-zA-Z0-9_\\-:]+$", "description": "The event to fire.", "title": "Event" }, + "target": { + "type": "string", + "description": "The target of the event.", + "title": "Target", + "enum": ["baby", "block", "damager", "other", "parent", "player", "self", "target"] + } + } +}