Skip to content

Get Attribute Operation

Converts minecraft:living_entity prototype into minecraft:entity_attribute_instance prototype such that it represents the instance of given attribute. If the target has no attribute returns nothing.

Examples

The operation is used to get attribute generic.luck on the player and then the value of it, such that the experience source gives extra experience every time player kill entity.

Click to view
json
{
	"type": "puffish_skills:kill_entity",
	"data": {
		"variables": {
			"luck_value": {
				"operations": [
					{
						"type": "get_player",
					},
					{
						"type": "as_living_entity",
					},
					{ 
						"type": "puffish_skills:attribute",
						"data": {
							"effect": "generic.luck"
						}
					},
					{
						"type": "get_value",
					}
				],
				"fallback": 0
			},
			"dropped_experience": {
				"operations": [
					{
						"type": "get_dropped_experience",
					}
				]
			},
		},
		"experience": "dropped_experience + luck_value * dropped_experience"
	}
}

JSON structure

PropertyTypeRequired
attributeattribute identifieryes