Fixing components and behaviors

This commit is contained in:
DaanV2
2022-06-07 23:20:52 +02:00
parent 3b33cf147e
commit c3807a664d
6 changed files with 206 additions and 75 deletions

View File

@@ -0,0 +1,53 @@
{
"$id": "blockception.minecraft.behavior.entities.minecraft.behavior.go_and_give_items_to_noteblock",
"type": "object",
"title": "Barter",
"description": "[EXPERIMENTAL BEHAVIOR] The entity will attempt to toss the items from its inventory to a nearby recently played noteblock.",
"additionalProperties": false,
"properties": {
"priority": {
"$ref": "types/priority.json"
},
"listen_time": {
"title": "listen time",
"type": "integer",
"default": 0.0,
"description": "Sets the time an entity should continue delivering items to a noteblock after hearing it."
},
"on_item_throw": {
"title": "on item throw",
"$ref": "../types/trigger.json",
"description": "Event(s) to run when this mob throws items."
},
"reach_block_distance": {
"title": "reach block distance",
"type": "number",
"default": 3000000,
"description": "Sets the desired distance to be reached before throwing the items towards the block."
},
"run_speed": {
"title": "run speed",
"type": "number",
"default": 1000000,
"description": "Sets the entity's speed when running toward the block."
},
"throw_force": {
"title": "throw force",
"type": "number",
"default": 0.2,
"description": "Sets the throw force."
},
"throw_sound": {
"title": "throw sound",
"type": "string",
"default": "",
"description": "Sound to play when this mob throws an item."
},
"vertical_throw_mul": {
"title": "vertical throw mul",
"type": "number",
"default": 1500000,
"description": "Sets the vertical throw multiplier that is applied on top of the throw force in the vertical direction."
}
}
}

View File

@@ -0,0 +1,47 @@
{
"$id": "blockception.minecraft.behavior.entities.minecraft.behavior.go_and_give_items_to_owner",
"type": "object",
"title": "Barter",
"description": "[EXPERIMENTAL BEHAVIOR] The entity will attempt to toss the items from its inventory to its owner.",
"additionalProperties": false,
"properties": {
"priority": {
"$ref": "types/priority.json"
},
"on_item_throw": {
"title": "on item throw",
"$ref": "../types/trigger.json",
"description": "Event(s) to run when this mob throws items."
},
"reach_mob_distance": {
"title": "reach mob distance",
"type": "number",
"default": 3000000,
"description": "Sets the desired distance to be reached before giving items to owner."
},
"run_speed": {
"title": "run speed",
"type": "number",
"default": 1000000,
"description": "Sets the entity's speed when running toward the owner."
},
"throw_force": {
"title": "throw force",
"type": "number",
"default": 0.2,
"description": "Sets the throw force."
},
"throw_sound": {
"title": "throw sound",
"type": "string",
"default": "item_thrown",
"description": "Sound to play when this mob throws an item."
},
"vertical_throw_mul": {
"title": "vertical throw mul",
"type": "number",
"default": 1500000,
"description": "Sets the vertical throw multiplier that is applied on top of the throw force in the vertical direction."
}
}
}

View File

@@ -3,58 +3,63 @@
"type": "object",
"title": "Move To Block",
"additionalProperties": false,
"description": "Makes the entity move towards specified blocks",
"$comment": "UNDOCUMENTED",
"description": "Allows mob to move towards a block.",
"required": [],
"properties": {
"priority": { "$ref": "./types/priority.json" },
"tick_interval": {
"goal_radius": {
"title": "Goal Radius",
"type": "number",
"title": "Tick Interval",
"description": "The amount ticks between each search",
"$comment": "UNDOCUMENTED"
"default": 0.5,
"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"
},
"on_stay_completed": {
"title": "On Stay Completed",
"description": "Event to run on completing a stay of stay_duration at the block.",
"$ref": "../types/trigger.json"
},
"on_reach": {
"type": "array",
"title": "On Reach",
"description": "Event to run on block reached.",
"$ref": "../types/trigger.json"
},
"start_chance": {
"type": "number",
"title": "Start Chance",
"description": "The chance that the entity starts on this block search",
"$comment": "UNDOCUMENTED"
"type": "number",
"default": 1.0,
"description": "Chance to start the behavior (applied after each random tick_interval)."
},
"search_range": {
"type": "number",
"title": "Search Range",
"description": "The range of blocks to search",
"$comment": "UNDOCUMENTED"
"type": "integer",
"default": 0,
"description": "The distance in blocks that the mob will look for the block."
},
"search_height": {
"type": "number",
"title": "Search Height",
"description": "How heigh the search can be, (or low)",
"$comment": "UNDOCUMENTED"
},
"goal_radius": {
"type": "number",
"title": "Goal Radius",
"description": "The radius when the entity must be within of the block to be considered 'there'",
"$comment": "UNDOCUMENTED"
"type": "integer",
"default": 1,
"description": "The height in blocks that the mob will look for the block."
},
"stay_duration": {
"type": "number",
"title": "Stay Duration",
"description": "The amount of time the entity stays near the block",
"$comment": "UNDOCUMENTED"
"type": "number",
"default": 0.0,
"description": "Number of ticks needed to complete a stay at the block."
},
"target_selection_method": {
"type": "string",
"title": "Target Selection Method",
"description": "UNDOCUMENTED",
"$comment": "UNDOCUMENTED"
"type": "string",
"default": "nearest",
"description": "Kind of block to find fitting the specification. Valid values are \"random\" and \"nearest\"."
},
"target_offset": {
"type": "array",
"title": "Target Offset",
"description": "UNDOCUMENTED",
"$comment": "UNDOCUMENTED",
"default": [0, 0, 0],
"description": "Offset to add to the selected target position.",
"items": [
{ "type": "number", "title": "X" },
{ "type": "number", "title": "Y" },
@@ -64,30 +69,17 @@
"target_blocks": {
"type": "array",
"title": "Target Blocks",
"description": "UNDOCUMENTED",
"$comment": "UNDOCUMENTED",
"description": "Block types to move to.",
"items": {
"$ref": "../../../../general/block/identifier.json",
"type": "string"
}
},
"on_stay_completed": {
"type": "array",
"title": "On Stay Completed",
"description": "The events to call whenever this entity has completed it staying duration",
"$comment": "UNDOCUMENTED",
"items": {
"$ref": "../types/event.json"
}
},
"on_reach": {
"type": "array",
"title": "On Reach",
"description": "The events to call whenever this entity has reached it goal, but is possibly still staying here",
"$comment": "UNDOCUMENTED",
"items": {
"$ref": "../types/event.json"
}
"tick_interval": {
"title": "Tick Interval",
"type": "integer",
"default": 20,
"description": "Average interval in ticks to try to run this behavior."
}
},
"examples": [

View File

@@ -0,0 +1,36 @@
{
"$id": "blockception.minecraft.behavior.entities.minecraft.behavior.stay_near_noteblock",
"type": "object",
"title": "Barter",
"description": "[EXPERIMENTAL BEHAVIOR] The entity will attempt to toss the items from its inventory to a nearby recently played noteblock.",
"additionalProperties": false,
"properties": {
"priority": {
"$ref": "types/priority.json"
},
"listen_time": {
"title": "listen time",
"type": "integer",
"default": 0.0,
"description": "Sets the time an entity should stay near a noteblock after hearing it."
},
"speed": {
"title": "speed",
"type": "number",
"default": 1000000,
"description": "Sets the entity's speed when moving toward the block."
},
"start_distance": {
"title": "start distance",
"type": "number",
"default": 10000000,
"description": "Sets the distance the entity needs to be away from the block to attempt to start the goal."
},
"stop_distance": {
"title": "stop distance",
"type": "number",
"default": 2000000,
"description": "Sets the distance from the block the entity will attempt to reach."
}
}
}

View File

@@ -229,6 +229,8 @@
"minecraft:behavior.follow_owner": { "$ref": "./behaviors/follow_owner.json" },
"minecraft:behavior.follow_parent": { "$ref": "./behaviors/follow_parent.json" },
"minecraft:behavior.follow_target_captain": { "$ref": "./behaviors/follow_target_captain.json" },
"minecraft:behavior.go_and_give_items_to_noteblock": { "$ref": "./behaviors/go_and_give_items_to_noteblock.json" },
"minecraft:behavior.go_and_give_items_to_owner": { "$ref": "./behaviors/go_and_give_items_to_owner.json" },
"minecraft:behavior.go_home": { "$ref": "./behaviors/go_home.json" },
"minecraft:behavior.guardian_attack": { "$ref": "./behaviors/guardian_attack.json" },
"minecraft:behavior.harvest_farm_block": { "$ref": "./behaviors/harvest_farm_block.json" },
@@ -316,6 +318,7 @@
"minecraft:behavior.squid_move_away_from_ground": { "$ref": "./behaviors/squid_move_away_from_ground.json" },
"minecraft:behavior.squid_out_of_water": { "$ref": "./behaviors/squid_out_of_water.json" },
"minecraft:behavior.stalk_and_pounce_on_target": { "$ref": "./behaviors/stalk_and_pounce_on_target.json" },
"minecraft:behavior.stay_near_noteblock": { "$ref": "./behaviors/stay_near_noteblock.json" },
"minecraft:behavior.stay_while_sitting": { "$ref": "./behaviors/stay_while_sitting.json" },
"minecraft:behavior.stomp_attack": { "$ref": "./behaviors/stomp_attack.json" },
"minecraft:behavior.stomp_turtle_egg": { "$ref": "./behaviors/stomp_turtle_egg.json" },

View File

@@ -24,47 +24,35 @@
}
}
},
"admire": {
"type": "boolean",
"default": false,
"description": "Enables the mob to admire the item",
"title": "Admire Item"
},
"barter": {
"type": "boolean",
"default": false,
"description": "Enables the component to drop an item as a barter exchange.",
"title": "Barter"
},
"cooldown": {
"title": "cooldown",
"type": "number",
"default": 0,
"description": "Time in seconds before this entity can be interacted with again.",
"title": "Cooldown"
"description": "Time in seconds before this entity can be interacted with again."
},
"cooldown_after_being_attacked": {
"title": "cooldown after being attacked",
"type": "number",
"default": "",
"description": "Duration, in seconds, for which mob won't barter items if it was hurt",
"title": "Cooldown After Being Attacked"
"default": 0,
"description": "Time in seconds before this entity can be interacted with after being attacked."
},
"health_amount": {
"type": "number",
"default": 0,
"description": "The amount of health this entity will recover or hurt when interacting with this item. Negative values will harm the entity.",
"title": "Health Amount"
},
"hurt_item": {
"title": "health amount",
"type": "integer",
"default": 0,
"description": "The amount of damage the item will take when used to interact with this entity. A value of 0 means the item won't lose durability.",
"title": "Hurt Item"
"description": "The amount of health this entity will recover or hurt when interacting with this item. Negative values will harm the entity."
},
"hurt_item": {
"title": "hurt item",
"type": "integer",
"default": 0,
"description": "The amount of damage the item will take when used to interact with this entity. A value of 0 means the item won't lose durability."
},
"interact_text": {
"title": "interact text",
"type": "string",
"default": "",
"description": "Text to show when the player is able to interact in this way with this entity when playing with Touch-screen controls.",
"title": "Interact Text"
"description": "Text to show when the player is able to interact in this way with this entity when playing with Touch-screen controls."
},
"on_interact": {
"$ref": "../types/trigger.json",
@@ -140,6 +128,18 @@
"title": "Vibration",
"type": "string",
"description": "Vibration to emit when the interaction occurs. Admitted values are entity_interact (used by default), shear, and none (no vibration emitted)."
},
"give_item": {
"type": "boolean",
"title": "Give Item",
"$comment": "UNDOCUMENTED",
"description": "UNDOCUMENTED Item to give to the player upon successful interaction."
},
"take_item": {
"type": "boolean",
"title": "Take Item",
"$comment": "UNDOCUMENTED",
"description": "UNDOCUMENTED Takes an item from the player"
}
}
}