From 0166d1c31f90b70456520b3b56886ad558e5ac57 Mon Sep 17 00:00:00 2001 From: DaanV2 Date: Tue, 20 Sep 2022 19:33:11 +0200 Subject: [PATCH] Processed new entity data --- .../behaviors/defend_trusted_target.json | 7 ++-- .../behaviors/nearest_attackable_target.json | 16 ++------- ...nearest_prioritized_attackable_target.json | 12 +++++-- .../behavior/entities/format/components.json | 9 +++-- .../game_event_movement_tracking.json | 27 ++++++++++++++ .../entities/format/types/entity_types.json | 35 ++++++++++++------- 6 files changed, 71 insertions(+), 35 deletions(-) create mode 100644 source/behavior/entities/format/components/game_event_movement_tracking.json diff --git a/source/behavior/entities/format/behaviors/defend_trusted_target.json b/source/behavior/entities/format/behaviors/defend_trusted_target.json index b2238685..92dd9fb1 100644 --- a/source/behavior/entities/format/behaviors/defend_trusted_target.json +++ b/source/behavior/entities/format/behaviors/defend_trusted_target.json @@ -44,10 +44,9 @@ "description": "Distance in blocks that the target can be within to launch an attack." }, "entity_types": { - "title": "Entity Types", - "type": "object", - "description": "List of entity types that this mob considers valid targets.", - "additionalProperties": false + "$ref": "../types/entity_types.json", + "description": "List of entity types this mob will startle (cause to jump) when it sneezes.", + "title": "Entity Types" }, "sound_chance": { "title": "Sound Chance", diff --git a/source/behavior/entities/format/behaviors/nearest_attackable_target.json b/source/behavior/entities/format/behaviors/nearest_attackable_target.json index 91af8a52..cc071bcc 100644 --- a/source/behavior/entities/format/behaviors/nearest_attackable_target.json +++ b/source/behavior/entities/format/behaviors/nearest_attackable_target.json @@ -40,19 +40,9 @@ "$ref": "./types/priority.json" }, "entity_types": { - "description": "Filters which types of targets are valid for this entity.", - "title": "Entity Types", - "oneOf": [ - { - "$ref": "#/definitions/entity_type" - }, - { - "type": "array", - "items": { - "$ref": "#/definitions/entity_type" - } - } - ] + "$ref": "../types/entity_types.json", + "description": "List of entity types this mob will startle (cause to jump) when it sneezes.", + "title": "Entity Types" }, "attack_interval": { "type": "integer", diff --git a/source/behavior/entities/format/behaviors/nearest_prioritized_attackable_target.json b/source/behavior/entities/format/behaviors/nearest_prioritized_attackable_target.json index cdadee18..af7a2d9a 100644 --- a/source/behavior/entities/format/behaviors/nearest_prioritized_attackable_target.json +++ b/source/behavior/entities/format/behaviors/nearest_prioritized_attackable_target.json @@ -9,9 +9,9 @@ "$ref": "./types/priority.json" }, "entity_types": { - "description": "List of entity types that this mob considers valid targets.", - "title": "Entity Types", - "$ref": "../types/entity_types.json" + "$ref": "../types/entity_types.json", + "description": "List of entity types this mob will startle (cause to jump) when it sneezes.", + "title": "Entity Types" }, "attack_interval": { "type": "integer", @@ -49,6 +49,12 @@ "description": "If true, the target will change to the current closest entity whenever a different entity is closer.", "title": "Reselect Targets" }, + "reevaluate_description": { + "title": "Reevaluate Description", + "type": "boolean", + "default": false, + "description": "If true, the mob will stop being targeted if it stops meeting any conditions." + }, "scan_interval": { "type": "integer", "default": 10, diff --git a/source/behavior/entities/format/components.json b/source/behavior/entities/format/components.json index e17225e9..79fa2a1a 100644 --- a/source/behavior/entities/format/components.json +++ b/source/behavior/entities/format/components.json @@ -62,6 +62,7 @@ "minecraft:flying_speed": { "$ref": "./components/flying_speed.json" }, "minecraft:follow_range": { "$ref": "./components/follow_range.json" }, "minecraft:friction_modifier": { "$ref": "./components/friction_modifier.json" }, + "minecraft:game_event_movement_tracking": { "$ref": "./components/game_event_movement_tracking.json" }, "minecraft:genetics": { "$ref": "./components/genetics.json" }, "minecraft:giveable": { "$ref": "./components/giveable.json" }, "minecraft:ground_offset": { "$ref": "./components/ground_offset.json" }, @@ -269,13 +270,17 @@ "minecraft:behavior.move_to_random_block": { "$ref": "./behaviors/move_to_random_block.json" }, "minecraft:behavior.move_to_village": { "$ref": "./behaviors/move_to_village.json" }, "minecraft:behavior.move_to_water": { "$ref": "./behaviors/move_to_water.json" }, - "minecraft:behavior.move_towards_dwelling_restriction": { "$ref": "./behaviors/move_towards_dwelling_restriction.json" }, + "minecraft:behavior.move_towards_dwelling_restriction": { + "$ref": "./behaviors/move_towards_dwelling_restriction.json" + }, "minecraft:behavior.move_towards_home_restriction": { "$ref": "./behaviors/move_towards_home_restriction.json" }, "minecraft:behavior.move_towards_restriction": { "$ref": "./behaviors/move_towards_restriction.json" }, "minecraft:behavior.move_towards_target": { "$ref": "./behaviors/move_towards_target.json" }, "minecraft:behavior.nap": { "$ref": "./behaviors/nap.json" }, "minecraft:behavior.nearest_attackable_target": { "$ref": "./behaviors/nearest_attackable_target.json" }, - "minecraft:behavior.nearest_prioritized_attackable_target": { "$ref": "./behaviors/nearest_prioritized_attackable_target.json" }, + "minecraft:behavior.nearest_prioritized_attackable_target": { + "$ref": "./behaviors/nearest_prioritized_attackable_target.json" + }, "minecraft:behavior.ocelot_sit_on_block": { "$ref": "./behaviors/ocelot_sit_on_block.json" }, "minecraft:behavior.ocelotattack": { "$ref": "./behaviors/ocelotattack.json" }, "minecraft:behavior.offer_flower": { "$ref": "./behaviors/offer_flower.json" }, diff --git a/source/behavior/entities/format/components/game_event_movement_tracking.json b/source/behavior/entities/format/components/game_event_movement_tracking.json new file mode 100644 index 00000000..d7e960a2 --- /dev/null +++ b/source/behavior/entities/format/components/game_event_movement_tracking.json @@ -0,0 +1,27 @@ +{ + "$id": "blockception.minecraft.behavior.entities.minecraft.game_event_movement_tracking", + "additionalProperties": false, + "description": "Allows an entity to emit `entityMove`, `swim` and `flap` game events, depending on the block the entity is moving through. It is added by default to every mob. Add it again to override its behavior.", + "type": "object", + "title": "Game Event Movement Tracking", + "properties": { + "emit_flap": { + "title": "emit flap", + "type": "boolean", + "default": false, + "description": "If true, the `flap` game event will be emitted when the entity moves through air." + }, + "emit_move": { + "title": "emit move", + "type": "boolean", + "default": true, + "description": "If true, the `entityMove` game event will be emitted when the entity moves on ground or through a solid." + }, + "emit_swim": { + "title": "emit swim", + "type": "boolean", + "default": true, + "description": "If true, the `swim` game event will be emitted when the entity moves through a liquid." + } + } +} diff --git a/source/behavior/entities/format/types/entity_types.json b/source/behavior/entities/format/types/entity_types.json index 5d0ee5e4..8d2a2bdc 100644 --- a/source/behavior/entities/format/types/entity_types.json +++ b/source/behavior/entities/format/types/entity_types.json @@ -14,18 +14,6 @@ "default": 16, "title": "Maximum Dist" }, - "walk_speed_multiplier": { - "type": "number", - "description": "Multiplier for the walking speed. A value of 1.0 means the speed is unchanged", - "default": 16, - "title": "Walk Speed Multiplier" - }, - "sprint_speed_multiplier": { - "type": "number", - "description": "Multiplier for the running speed. A value of 1.0 means the speed is unchanged", - "default": 16, - "title": "Sprint Speed Multiplier" - }, "must_see": { "type": "boolean", "description": "If true, the mob has to be visible to be a valid choice.", @@ -37,9 +25,30 @@ "description": "Determines the amount of time in seconds that this mob will look for a target before forgetting about it and looking for a new one when the target isn't visible any more.", "default": 3, "title": "Must See Forget Duration" + }, + "reevaluate_description": { + "title": "Reevaluate Description", + "type": "boolean", + "default": false, + "description": "If true, the mob will stop being targeted if it stops meeting any conditions." + }, + "sprint_speed_multiplier": { + "type": "number", + "description": "Multiplier for the running speed. A value of 1.0 means the speed is unchanged", + "default": 16, + "title": "Sprint Speed Multiplier" + }, + "walk_speed_multiplier": { + "type": "number", + "description": "Multiplier for the walking speed. A value of 1.0 means the speed is unchanged", + "default": 16, + "title": "Walk Speed Multiplier" } } } }, - "oneOf": [{ "type": "array", "items": { "$ref": "#/definitions/entity_definition" } }, { "$ref": "#/definitions/entity_definition" }] + "oneOf": [ + { "type": "array", "items": { "$ref": "#/definitions/entity_definition" } }, + { "$ref": "#/definitions/entity_definition" } + ] }