Too Many Attributes
» Entity actions » Raycast radius

Raycast radius

origins:raycast · entity action · entity condition · new field

TMA adds a radius field to Origins' own raycast action and condition. It makes the ray thick: an entity is hit when its hitbox comes within radius blocks of the ray. Use it for wide beams, or to make small or fast targets easier to hit.

FieldTypeDefaultDescription
radiusDouble0How far from the ray an entity can be and still be hit, in blocks. 0 is Origins' normal thin ray.
  • Every other raycast field works as before. Packs that don't use radius behave exactly as without TMA.
  • Blocks still stop the ray. When a block is nearer than the entity hit, the block is hit, as normal.
  • With several entities near the ray, the one whose hit is nearest the start of the ray is picked.
  • The hit position, used by command_at_hit and the like, is where the ray enters the widened hitbox.
  • A pack that uses radius still loads without TMA. The ray is just thin.

Example: "Beam". Pressing your primary key hits the first entity within 1.5 blocks of your line of sight, up to 24 blocks away.

json
{
  "type": "origins:active_self",
  "entity_action": {
    "type": "origins:raycast",
    "distance": 24,
    "radius": 1.5,
    "block": true,
    "entity": true,
    "bientity_action": {
      "type": "origins:damage",
      "amount": 4,
      "damage_type": "minecraft:magic"
    }
  },
  "cooldown": 40,
  "key": {
    "key": "key.origins.primary_active"
  }
}