Skip to content

Is Nearest (Bientity Condition Type)

Zac edited this page Nov 11, 2026 · 1 revision

Bientity Condition Type


Checks if the target entity is the nearest entity to the actor.

Tip

Use the bientity_condition to check for entity types or to find the second nearest entity.

originscontent:is_nearest

Fields

Field Type Default Description
distance Float 64.0 The max distance to check for nearby entities.
bientity_condition Bientity Condition null Entities to ignore while searching for nearby entities. If null, assume condition passed. The actor is the, well, actor, and the target is the other entity.

Examples

"bientity_condition": {
  "type": "originscontent:is_nearest",
  "bientity_condition": {
    "type": "origins:target_condition",
    "condition": {
      "type": "origins:entity_type",
      "entity_type": "minecraft:player"
    }
  }
}

This example checks if the target is the nearest player to the actor.

"bientity_condition": {
  "type": "origins:or",
  "conditions": [
    {
      "type": "originscontent:is_nearest"
    },
    {
      "type": "originscontent:is_nearest",
      "bientity_condition": {
        "type": "originscontent:is_nearest",
        "inverted": true
      }
    },
    {
      "type": "originscontent:is_nearest",
      "bientity_condition": {
        "type": "origins:and",
        "conditions": [
          {
            "type": "originscontent:is_nearest",
            "inverted": true
          },
          {
            "type": "originscontent:is_nearest",
            "bientity_condition": {
              "type": "originscontent:is_nearest",
              "inverted": true
            },
            "inverted": true
          }
        ]
      }
    }
  ]
}

This example checks if the entity is one of the three nearest entities to the actor.

Clone this wiki locally