Skip to content

Commit

Permalink
Misc entity fixes (#248)
Browse files Browse the repository at this point in the history
* - Misc entity fixes

* - Update entity sensor

* Update source/behavior/entities/format/behaviors/dig.json

Co-authored-by: Daan Verstraten <[email protected]>

* - Change entity sensor range property

* - Fix

---------

Co-authored-by: Daan Verstraten <[email protected]>
  • Loading branch information
Xterionix and DaanV2 authored Mar 23, 2024
1 parent 6f7a280 commit 7982212
Show file tree
Hide file tree
Showing 12 changed files with 75 additions and 16 deletions.
5 changes: 5 additions & 0 deletions source/behavior/entities/format/behaviors/dig.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
"type": "boolean",
"default": false,
"description": "If true, vibrations count as disturbances that may delay the start of this goal."
},
"on_start": {
"title": "On Start",
"$ref": "../types/trigger.json",
"description": "The event to run when the goal start"
}
}
}
4 changes: 2 additions & 2 deletions source/behavior/entities/format/behaviors/emerge.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
"$id": "blockception.minecraft.behavior.entities.minecraft.behavior.emerge",
"type": "object",
"title": "Emerge",
"description": "[EXPERIMENTAL BEHAVIOR] Activates the `EMERGING` actor flag during the specified duration and triggers `on_done` at the end",
"description": "Activates the `EMERGING` actor flag during the specified duration and triggers `on_done` at the end",
"additionalProperties": false,
"required": [],
"properties": {
"priority": { "$ref": "./types/priority.json" },
"cooldown_time": {
"title": "Cooldown Time",
"type": "integer",
"type": "number",
"default": 0.5,
"description": "Time in seconds the mob has to wait before using the goal again."
},
Expand Down
6 changes: 6 additions & 0 deletions source/behavior/entities/format/behaviors/float.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,12 @@
"properties": {
"priority": {
"$ref": "./types/priority.json"
},
"sink_with_passengers": {
"title": "Sink With Passengers",
"description": "If true, the mob will keep sinking as long as it has passengers.",
"type": "boolean",
"default": false
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,15 @@
"title": "Cooldown Range",
"default": [0.0, 0.0],
"description": "Goal cooldown range in seconds.",
"$ref": "../../../../general/vectors/number2.json"
"anyOf": [
{
"$ref": "../../../../general/vectors/number2.json"
},
{
"type": "number",
"minimum": 0
}
]
},
"digging_duration_range": {
"title": "Digging Duration Range",
Expand Down
6 changes: 6 additions & 0 deletions source/behavior/entities/format/behaviors/sleep.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
"type": "number",
"default": 8.0,
"description": "The cooldown time in seconds before the goal can be reused after a internal failure or timeout condition."
},
"goal_radius": {
"title": "Goal Radius",
"description": "Distance in blocks within the mob considers it has reached the goal. This is the \"wiggle room\" to stop the AI from bouncing back and forth trying to reach a specific spot",
"default": 0.5,
"type": "number"
}
},
"examples": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@
"properties": {
"priority": {
"$ref": "./types/priority.json"
},
"filters": {
"title": "Filters",
"$ref": "../../filters/filters.json",
"description": "Conditions that need to be met for the behavior to start."
}
}
}
4 changes: 3 additions & 1 deletion source/behavior/entities/format/components.json
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@
"minecraft:is_hidden_when_invisible": { "$ref": "./components/is_hidden_when_invisible.json" },
"minecraft:is_ignited": { "$ref": "./components/is_ignited.json" },
"minecraft:is_illager_captain": { "$ref": "./components/is_illager_captain.json" },
"minecraft:is_pregnant": { "$ref": "./components/is_pregnant.json" },
"minecraft:is_saddled": { "$ref": "./components/is_saddled.json" },
"minecraft:is_shaking": { "$ref": "./components/is_shaking.json" },
"minecraft:is_sheared": { "$ref": "./components/is_sheared.json" },
Expand Down Expand Up @@ -223,7 +224,7 @@
"minecraft:behavior.eat_block": { "$ref": "./behaviors/eat_block.json" },
"minecraft:behavior.eat_carried_item": { "$ref": "./behaviors/eat_carried_item.json" },
"minecraft:behavior.eat_mob": { "$ref": "./behaviors/eat_mob.json" },
"minecraft:behavior.emerge": { "$ref": "./behaviors/eat_mob.json" },
"minecraft:behavior.emerge": { "$ref": "./behaviors/emerge.json" },
"minecraft:behavior.enderman_leave_block": { "$ref": "./behaviors/enderman_leave_block.json" },
"minecraft:behavior.enderman_take_block": { "$ref": "./behaviors/enderman_take_block.json" },
"minecraft:behavior.equip_item": { "$ref": "./behaviors/equip_item.json" },
Expand Down Expand Up @@ -327,6 +328,7 @@
"minecraft:behavior.slime_random_direction": { "$ref": "./behaviors/slime_random_direction.json" },
"minecraft:behavior.snacking": { "$ref": "./behaviors/snacking.json" },
"minecraft:behavior.sneeze": { "$ref": "./behaviors/sneeze.json" },
"minecraft:behavior.sniff": { "$ref": "./behaviors/sniff.json" },
"minecraft:behavior.sonic_boom": { "$ref": "./behaviors/sonic_boom.json" },
"minecraft:behavior.squid_dive": { "$ref": "./behaviors/squid_dive.json" },
"minecraft:behavior.squid_flee": { "$ref": "./behaviors/squid_flee.json" },
Expand Down
15 changes: 11 additions & 4 deletions source/behavior/entities/format/components/entity_sensor.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,17 @@
"title": "Minimum Count"
},
"range": {
"type": "number",
"default": 10,
"description": "[UNDOCUMENTED] The maximum distance another entity can be from this and have the filters checked against it.",
"title": "Range"
"description": "The maximum distance another entity can be from this and have the filters checked against it.",
"title": "Range",
"anyOf": [
{
"$ref": "../../../../general/vectors/number2.json"
},
{
"default": 10,
"type": "number"
}
]
},
"require_all": {
"type": "boolean",
Expand Down
4 changes: 2 additions & 2 deletions source/behavior/entities/format/components/follow_range.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
"properties": {
"value": {
"type": "integer",
"description": "Range of the amount of damage the melee follow_range deals. A negative value can heal the entity instead of hurting it.",
"description": "The distance this entity can be from the target when following it",
"title": "Value"
},
"max": {
"type": "integer",
"description": "Duration, in seconds, of the status ailment applied to the damaged entity.",
"description": "Maximum distance this entity can be from the target when following it",
"title": "Max"
}
},
Expand Down
9 changes: 9 additions & 0 deletions source/behavior/entities/format/components/is_pregnant.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"$id": "blockception.minecraft.behavior.entities.minecraft.is_pregnant",
"description": "Sets that this entity is currently is_pregnant",
"type": "object",
"title": "Is Pregnant",
"additionalProperties": false,
"required": [],
"properties": {}
}
18 changes: 12 additions & 6 deletions source/behavior/entities/format/components/projectile.json
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,9 @@
},
"douse_fire": {
"title": "Douse Fire",
"description": "If the target is on fire, then douse the fire.",
"type": "boolean",
"default": false,
"description": "If the target is on fire, then douse hte fire."
"default": false
},
"freeze_on_hit": {
"title": "Freeze On Hit",
Expand Down Expand Up @@ -285,9 +285,9 @@
"properties": {
"catch_fire": {
"title": "Catch Fire",
"description": "Determines if the struck object is set on fire.",
"type": "boolean",
"default": false,
"description": "Determines if the struck object is set on fire."
"default": false
},
"channeling": {
"title": "Channeling",
Expand Down Expand Up @@ -361,6 +361,12 @@
"type": "boolean",
"default": false,
"description": "If true, then the hit must cause damage to update the last hurt property."
},
"should_bounce": {
"title": "Should Bounce",
"description": "If true, the projectile will bounce",
"type": "boolean",
"default": false
}
}
},
Expand Down Expand Up @@ -585,9 +591,9 @@
},
"teleport_owner": {
"title": "Teleport Owner",
"description": "Determines if the owner is transported on hit.",
"type": "boolean",
"default": false,
"description": "Determines if the owner is transported on hit."
"default": false
},
"thrown_potion_effect": {
"title": "Thrown Potion Effect",
Expand Down
5 changes: 5 additions & 0 deletions source/behavior/entities/format/components/spawn_entity.json
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,11 @@
"default": "plop",
"description": "Identifier of the sound effect to play when the entity is spawned.",
"title": "Spawn Sound"
},
"spawn_item_event": {
"description": "Event to call on this entity when the item is spawned.",
"title": "Spawn Item Event",
"$ref": "../types/event_object.json"
}
}
}
Expand Down

0 comments on commit 7982212

Please sign in to comment.