Skip to content
Joe Goett edited this page Jul 2, 2015 · 1 revision

Filters are a way to go through different objects (entities, tile entities, etc) and determine if that object satisfies certain attributes.

Filters are typically stored as a JSON object, as shown in the examples below.

All

Matches all objects.

Value - None

Ex:

{
  "type": "All"
}

Class

Checks based on the (short) Class name.

Value - String (Eg: EntityPig)

Ex:

{
  "type": "Class",
  "value": "EntityPig"
}

Dimension

Checks based on the dimension

Value - Array of dimension IDs

Ex:

{
  "type": "Dimension"
  "value": [0, 1]
}

Hash

Checks based on the Java hashcode

Value - Integer

Instance

Checks its its a class/superclass

Value - String, full class name (Eg: net.minecraft.entity.item.EntityItem)

Ex:

{
  "type": "Instance"
  "value": "net.minecraft.entity.item.EntityItem"
}

LClass

Checks the full class name

Value - String, Full Class name (Eg: net.minecraft.passive.EntityPig)

Ex:

{
  "type": "LClass"
  "value": "net.minecraft.passive.EntityPig"
}

Name

Checks based on names

Value - String (Eg: Zombie)

Ex:

{
  "type": "Name"
  "value": "Zombie"
}

Pos

Checks based on the entity position

Value - Object holding x1, y1, z1 and optionally x2, y2, z2

Ex:

{
  "type": "Pos"
  "value": {
    "x1": 0,
    "y1": 0,
    "z1": 0,
    "x2": 50,
    "y2": 50,
    "z2": 50
  }
}

Where

Checks based on chunk coordinates

Value - Object holding x1, z1 and optionally x2, z2

Ex:

{
  "type": ""
  "value": {
    "x1": -1,
    "z1": -1,
    "x2": 1,
    "z2": 1
  }
}

Multi

Checks multiple filters together in an all-or-nothing manner

Value - An array of other filters. (I heard you like filters in your filters...)

Ex:

{
  "type": "Multi"
  "value": [
    {
      "type": "Name",
      "value": "Zombie"
    },
    {
      "type": "Dimension",
      "value": [0]
    }
  ]
}
Clone this wiki locally