1. Wiki
  2. /Entities
  3. /minecraft:ignore_cannot_be_attacked

minecraft:ignore_cannot_be_attacked

Don't want to write this by hand? GodCraft sets minecraft:ignore_cannot_be_attacked for you with a switch.Get GodCraft

Overview

minecraft:ignore_cannot_be_attacked is an entity component: it goes in the components object of a custom mob, or in one of its component groups. Lets this entity attack entities that have minecraft:cannot_be_attacked. Use filters to pick which ones.

Fields

FieldTypeDefaultDescription
filtersFilter Group{"AND":null,"NOT":null,"OR":null,"all":null,"all_of":null,"any":null,"any_of":null,"none_of":null}Which protected entities (as "other") may still be attacked; leave empty to allow all.

Example

Inside the components object of BP/entities/<name>.json (values are the defaults or placeholders):

BP/entities/<name>.json
{
  "minecraft:ignore_cannot_be_attacked": {
    "filters": {
      "AND": null,
      "NOT": null,
      "OR": null,
      "all": null,
      "all_of": null,
      "any": null,
      "any_of": null,
      "none_of": null
    }
  }
}

We use cookies to improve your experience and analyse site traffic. Learn more