From d8b8727d9e6687334eb7f25bbee518475d8b3ef4 Mon Sep 17 00:00:00 2001 From: Xterionix <72647213+Xterionix@users.noreply.github.com> Date: Fri, 14 Jun 2024 11:52:09 +0500 Subject: [PATCH] 1.21 (#292) * - Add new block material * - Update to 1.21 --- .../format/components/transformation.json | 61 ++++++++++--- .../format/behaviors/delayed_attack.json | 4 +- .../format/behaviors/dragonchargeplayer.json | 2 +- .../format/behaviors/dragonstrafeplayer.json | 2 +- .../format/behaviors/look_at_entity.json | 4 +- .../format/behaviors/look_at_player.json | 4 +- .../format/behaviors/look_at_target.json | 6 +- .../behaviors/look_at_trading_player.json | 6 +- .../entities/format/behaviors/panic.json | 2 +- .../behavior/entities/format/components.json | 2 + .../components/mob_effect_immunity.json | 24 +++++ .../format/components/projectile.json | 15 ++++ .../components/reflect_projectiles.json | 88 +++++++++++++++++++ 13 files changed, 193 insertions(+), 27 deletions(-) create mode 100644 source/behavior/entities/format/components/mob_effect_immunity.json create mode 100644 source/behavior/entities/format/components/reflect_projectiles.json diff --git a/source/behavior/blocks/format/components/transformation.json b/source/behavior/blocks/format/components/transformation.json index c51bc925..02bc189b 100644 --- a/source/behavior/blocks/format/components/transformation.json +++ b/source/behavior/blocks/format/components/transformation.json @@ -7,24 +7,21 @@ "properties": { "rotation": { "title": "Rotation", - "description": "Rotation in xxx?", + "description": "Amount in degrees the block should be rotated on each axis. \"rotation\" is specified as [x, y, z] using floating point values and must be axis aligned, otherwise the value will be rounded to the nearest axis-aligned value.", "type": "array", "items": [ { "title": "X", - "description": "Rotation in xxx?", "type": "number", "default": 0 }, { "title": "Y", - "description": "Rotation in xxx?", "type": "number", "default": 0 }, { "title": "Z", - "description": "Rotation in xxx?", "type": "number", "default": 0 } @@ -32,24 +29,21 @@ }, "scale": { "title": "Scale", - "description": "UNDOCUMENTED", + "description": "Amount the block should be scaled along each axis. \"scale\" is specified as [x, y, z] using floating point values.", "type": "array", "items": [ { "title": "X", - "description": "UNDOCUMENTED", "type": "number", "default": 1 }, { "title": "Y", - "description": "UNDOCUMENTED", "type": "number", "default": 1 }, { "title": "Z", - "description": "UNDOCUMENTED", "type": "number", "default": 1 } @@ -57,24 +51,67 @@ }, "translation": { "title": "Translation", - "description": "UNDOCUMENTED", + "description": "Amount the block should be translated along each axis. \"translation\" is specified as [x, y, z] using floating point values.", "type": "array", "items": [ { "title": "X", - "description": "UNDOCUMENTED", "type": "number", "default": 0 }, { "title": "Y", - "description": "UNDOCUMENTED", "type": "number", "default": 0 }, { "title": "Z", - "description": "UNDOCUMENTED", + "type": "number", + "default": 0 + } + ] + }, + "scale_pivot": { + "title": "Scale Pivot", + "description": "Offset to the pivot point around which to apply the scale. \"scale_pivot\" is specified as [x, y, z] using floating point values.", + "type": "array", + "default": [0, 0, 0], + "items": [ + { + "title": "X", + "type": "number", + "default": 0 + }, + { + "title": "Y", + "type": "number", + "default": 0 + }, + { + "title": "Z", + "type": "number", + "default": 0 + } + ] + }, + "rotation_pivot": { + "title": "Rotation Pivot", + "description": "Offset to the pivot point around which to apply the rotation. \"rotation_pivot\" is specified as [x, y, z] using floating point values.", + "type": "array", + "default": [0, 0, 0], + "items": [ + { + "title": "X", + "type": "number", + "default": 0 + }, + { + "title": "Y", + "type": "number", + "default": 0 + }, + { + "title": "Z", "type": "number", "default": 0 } diff --git a/source/behavior/entities/format/behaviors/delayed_attack.json b/source/behavior/entities/format/behaviors/delayed_attack.json index 7c417995..3f103b37 100644 --- a/source/behavior/entities/format/behaviors/delayed_attack.json +++ b/source/behavior/entities/format/behaviors/delayed_attack.json @@ -110,7 +110,7 @@ "reach_multiplier": { "title": "Reach Multiplier", "type": "number", - "default": 2, + "default": 1.5, "description": "Used with the base size of the entity to determine minimum target-distance before trying to deal attack damage." }, "require_complete_path": { @@ -133,7 +133,7 @@ "track_target": { "title": "Track Target", "type": "boolean", - "default": false, + "default": true, "description": "Allows the entity to track the attack target, even if the entity has no sensing." }, "x_max_rotation": { diff --git a/source/behavior/entities/format/behaviors/dragonchargeplayer.json b/source/behavior/entities/format/behaviors/dragonchargeplayer.json index 5e8f0f37..95bd1dd6 100644 --- a/source/behavior/entities/format/behaviors/dragonchargeplayer.json +++ b/source/behavior/entities/format/behaviors/dragonchargeplayer.json @@ -11,7 +11,7 @@ "active_speed": { "title": "Active Speed", "type": "number", - "default": 1, + "default": 3, "description": "The speed this entity moves when this behavior has started or while it's active." }, "continue_charge_threshold_time": { diff --git a/source/behavior/entities/format/behaviors/dragonstrafeplayer.json b/source/behavior/entities/format/behaviors/dragonstrafeplayer.json index d575d9df..3750b908 100644 --- a/source/behavior/entities/format/behaviors/dragonstrafeplayer.json +++ b/source/behavior/entities/format/behaviors/dragonstrafeplayer.json @@ -11,7 +11,7 @@ "active_speed": { "title": "Active Speed", "type": "number", - "default": 1, + "default": 3, "description": "The speed this entity moves when this behavior has started or while it's active." }, "fireball_range": { diff --git a/source/behavior/entities/format/behaviors/look_at_entity.json b/source/behavior/entities/format/behaviors/look_at_entity.json index b20a5058..86f806fa 100644 --- a/source/behavior/entities/format/behaviors/look_at_entity.json +++ b/source/behavior/entities/format/behaviors/look_at_entity.json @@ -18,13 +18,13 @@ "probability": { "type": "number", "default": 0.02, - "description": "The probability of looking at the target. A value of 1.00 is 100%", + "description": "The probability of looking at the target. A value of 1.00 is 100%.", "title": "Probability" }, "look_time": { "$ref": "../types/range_number_type.json", "default": [2, 4], - "description": "Time range to look at the entity.", + "description": "Time range to look at the nearest entity.", "title": "Look Time" }, "angle_of_view_vertical": { diff --git a/source/behavior/entities/format/behaviors/look_at_player.json b/source/behavior/entities/format/behaviors/look_at_player.json index 9e65b4da..bfc28fe2 100644 --- a/source/behavior/entities/format/behaviors/look_at_player.json +++ b/source/behavior/entities/format/behaviors/look_at_player.json @@ -31,13 +31,13 @@ "type": "number", "default": 0.02, "minimum": 0, - "description": "The probability of looking at the target. A value of 1.00 is 100%" + "description": "The probability of looking at the target. A value of 1.00 is 100%." }, "look_time": { "title": "Look Time", "type": "array", "default": [2, 4], - "description": "Time range to look at the entity.", + "description": "Time range to look at the nearest player.", "items": [ { "type": "number", "title": "Minimum", "description": "The minimum amount of time to look." }, { "type": "number", "title": "Maximum", "description": "The maximum amount of time to look." } diff --git a/source/behavior/entities/format/behaviors/look_at_target.json b/source/behavior/entities/format/behaviors/look_at_target.json index ba417a06..de6b1f6a 100644 --- a/source/behavior/entities/format/behaviors/look_at_target.json +++ b/source/behavior/entities/format/behaviors/look_at_target.json @@ -12,19 +12,19 @@ "look_distance": { "type": "number", "default": 8.0, - "description": "The distance in blocks from which the entity will look at.", + "description": "The distance in blocks from which the entity will look at this mob's current target.", "title": "Look Distance" }, "probability": { "type": "number", "default": 0.02, - "description": "The probability of looking at the target. A value of 1.00 is 100%", + "description": "The probability of looking at the target. A value of 1.00 is 100%.", "title": "Probability" }, "look_time": { "$ref": "../types/range_number_type.json", "default": [2, 4], - "description": "Time range to look at the entity.", + "description": "Time range to look at this mob's current target.", "title": "Look Time" }, "angle_of_view_vertical": { diff --git a/source/behavior/entities/format/behaviors/look_at_trading_player.json b/source/behavior/entities/format/behaviors/look_at_trading_player.json index 35890ee3..158477a5 100644 --- a/source/behavior/entities/format/behaviors/look_at_trading_player.json +++ b/source/behavior/entities/format/behaviors/look_at_trading_player.json @@ -12,19 +12,19 @@ "look_distance": { "type": "number", "default": 8.0, - "description": "The distance in blocks from which the entity will look at.", + "description": "The distance in blocks from which the entity will look at the player this mob is trading with.", "title": "Look Distance" }, "probability": { "type": "number", "default": 0.02, - "description": "The probability of looking at the target. A value of 1.00 is 100%", + "description": "The probability of looking at the target. A value of 1.00 is 100%.", "title": "Probability" }, "look_time": { "$ref": "../types/range_number_type.json", "default": [2, 4], - "description": "Time range to look at the entity.", + "description": "Time range to look at the player this mob is trading with.", "title": "Look Time" }, "angle_of_view_vertical": { diff --git a/source/behavior/entities/format/behaviors/panic.json b/source/behavior/entities/format/behaviors/panic.json index 1821f1c5..58dad8c7 100644 --- a/source/behavior/entities/format/behaviors/panic.json +++ b/source/behavior/entities/format/behaviors/panic.json @@ -18,7 +18,7 @@ "items": { "$ref": "../../../../general/entity/damage_source.json" }, - "default": [["all"]], + "default": ["campfire", "entity_attack", "entity_explosion", "fire", "fire_tick", "fireworks", "freezing", "lava", "lightning", "magic", "magma", "projectile", "ram_attack", "sonic_boom", "soul_campfire", "temperature", "wither"], "description": "The list of Entity Damage Sources that will cause this mob to panic." }, "force": { diff --git a/source/behavior/entities/format/components.json b/source/behavior/entities/format/components.json index 3999cd17..0412bfcc 100644 --- a/source/behavior/entities/format/components.json +++ b/source/behavior/entities/format/components.json @@ -113,6 +113,7 @@ "minecraft:managed_wandering_trader": { "$ref": "./components/managed_wandering_trader.json" }, "minecraft:mark_variant": { "$ref": "./components/mark_variant.json" }, "minecraft:mob_effect": { "$ref": "./components/mob_effect.json" }, + "minecraft:mob_effect_immunity": { "$ref": "./components/mob_effect_immunity.json" }, "minecraft:movement_sound_distance_offset": { "$ref": "./components/movement_sound_distance_offset.json" }, "minecraft:movement.amphibious": { "$ref": "./components/movement.amphibious.json" }, "minecraft:movement.basic": { "$ref": "./components/movement.basic.json" }, @@ -160,6 +161,7 @@ "minecraft:rail_sensor": { "$ref": "./components/rail_sensor.json" }, "minecraft:ravager_blocked": { "$ref": "./components/ravager_blocked.json" }, "minecraft:rideable": { "$ref": "./components/rideable.json" }, + "minecraft:reflect_projectiles": { "$ref": "./components/reflect_projectiles.json" }, "minecraft:scale_by_age": { "$ref": "./components/scale_by_age.json" }, "minecraft:scale": { "$ref": "./components/scale.json" }, "minecraft:scheduler": { "$ref": "./components/scheduler.json" }, diff --git a/source/behavior/entities/format/components/mob_effect_immunity.json b/source/behavior/entities/format/components/mob_effect_immunity.json new file mode 100644 index 00000000..007a61d5 --- /dev/null +++ b/source/behavior/entities/format/components/mob_effect_immunity.json @@ -0,0 +1,24 @@ +{ + "$id": "blockception.minecraft.behavior.entities.minecraft.mob_effect_immunity", + "type": "object", + "title": "Mob Effect Immunity", + "description": "Entities with this component will have an immunity to the provided mob effects.", + "additionalProperties": false, + "properties": { + "mob_effects": { + "title": "Mob Effects", + "description": "List of names of effects the entity is immune to.", + "type": "array", + "uniqueItems": true, + "minItems": 1, + "items": { + "type": "string" + } + } + }, + "examples": [ + { + "mob_effects": [ "oozing" ] + } + ] +} diff --git a/source/behavior/entities/format/components/projectile.json b/source/behavior/entities/format/components/projectile.json index 6d4b0cab..441d3a92 100644 --- a/source/behavior/entities/format/components/projectile.json +++ b/source/behavior/entities/format/components/projectile.json @@ -53,6 +53,21 @@ "description": "The gravity applied to this entity when thrown. When this actor is not on the ground, subtracts this amount from the actors change in vertical position every tick. The higher the value, the faster the entity falls.", "title": "Gravity" }, + "hit_nearest_passenger": { + "type": "boolean", + "default": false, + "title": "Hit Nearest Passenger", + "description": "If true, when hitting a vehicle, and there's at least one passenger in the vehicle, the damage will be dealt to the passenger closest to the projectile impact point. If there are no passengers, this setting does nothing." + }, + "ignored_entities": { + "title": "Ignored Entities", + "description": "[EXPERIMENTAL] An array of strings defining the types of entities that this entity does not collide with.", + "type": "array", + "minItems": 1, + "items": { + "type": "string" + } + }, "hit_ground_sound": { "$ref": "../../../../general/sound_event.json", "default": "", diff --git a/source/behavior/entities/format/components/reflect_projectiles.json b/source/behavior/entities/format/components/reflect_projectiles.json new file mode 100644 index 00000000..814f9682 --- /dev/null +++ b/source/behavior/entities/format/components/reflect_projectiles.json @@ -0,0 +1,88 @@ +{ + "$id": "blockception.minecraft.behavior.entities.minecraft.reflect_projectiles", + "type": "object", + "title": "Reflect Projectiles", + "description": "[EXPERIMENTAL] Allows an entity to reflect projectiles.", + "additionalProperties": false, + "properties": { + "azimuth_angle": { + "title": "Azimuth Angle", + "description": "A Molang expression defining the angle in degrees to add to the projectile's y axis rotation.", + "default": 0, + "anyOf": [ + { + "type":"string" + }, + { + "type": "number" + } + ] + }, + "elevation_angle": { + "title": "Elevation Angle", + "description": "A Molang expression defining the angle in degrees to add to the projectile's x axis rotation.", + "default": 0, + "anyOf": [ + { + "type":"string" + }, + { + "type": "number" + } + ] + }, + "reflected_projectiles": { + "title": "Reflected Projectiles", + "description": "An array of strings defining the types of projectiles that are reflected when they hit the entity.", + "type":"array", + "uniqueItems": true, + "items": { + "type": "string" + } + }, + "reflection_scale": { + "title": "Refelction Scale", + "description": "A Molang expression defining the velocity scaling of the reflected projectile. Values below 1 decrease the projectile's velocity, and values above 1 increase it.", + "default": 1, + "anyOf": [ + { + "type":"string" + }, + { + "type": "number" + } + ] + }, + "reflection_sound": { + "title": "Reflection Sound", + "description": "A string defining the name of the sound event to be played when a projectile is reflected. \"reflect\" unless specified.", + "default": "reflect", + "type": "string" + } + }, + "examples": [ + { + "reflected_projectiles": [ + "xp_bottle", + "thrown_trident", + "shulker_bullet", + "dragon_fireball", + "arrow", + "snowball", + "egg", + "fireball", + "splash_potion", + "ender_pearl", + "wither_skull", + "wither_skull_dangerous", + "small_fireball", + "lingering_potion", + "llama_spit", + "fireworks_rocket", + "fishing_hook" + ], + "azimuth_angle": "180.0 + Math.random(-20.0, 20.0)", + "reflection_scale": "0.5" + } + ] +}