Skip to content

Test Entity Type Operation

Converts minecraft:entity_type prototype into puffish_skills:boolean prototype whether the condition matches given entity.

INFO

If you also want to test for entity NBT use Test Entity Operation.

Examples

The operation is used to test entity type, such that the experience source gives the player exactly 5 experience every time the player kills zombie entity.

Click to view
json
{
	"type": "puffish_skills:kill_entity",
	"data": {
		"variables": {
			"exp_value": {
				"operations": [
					{
						"type": "killed_living_entity"
					},
					{
						"type": "type"
					},
					{ 
						"type": "puffish_skills:test",
						"data": {
							"entity_type": "zombie"
						}
					},
					{
						"type": "switch",
						"data": {
							"true": 5,
							"false": 0
						}
					}
				]
			}
		},
		"experience": "exp_value"
	}
}

The operation is used to test entity type tag, such that the experience source gives the player exactly 5 experience every time the player kills any entity with type tag undead.

Click to view
json
{
	"type": "puffish_skills:kill_entity",
	"data": {
		"variables": {
			"exp_value": {
				"operations": [
					{
						"type": "get_killed_living_entity"
					},
					{
						"type": "get_type"
					},
					{ 
						"type": "puffish_skills:test",
						"data": {
							"entity_type": "#undead"
						}
					},
					{
						"type": "switch",
						"data": {
							"true": 5,
							"false": 0
						}
					}
				]
			}
		},
		"experience": "exp_value"
	}
}

JSON structure

PropertyTypeRequired
entity_typeentity identifier or entity tagyes