Skip to content

Deal Damage Experience Source ​

Experience Source puffish_skills:deal_damage gives experience when player deals damage to the other entity.

This Experience Source uses Variables and Calculation.

Properties ​

Tamed ​

Property tamed defines how actions performed by tamed entities are counted by this experience source.

There are three possible options:

  • exclude - Actions performed by tamed entities are ignored. Only actions performed by players are counted.
  • include - Both actions performed by players and tamed entities are counted.
  • only - Only actions performed by tamed entities are counted. Actions performed by players are ignored.

If not set then defaults to excluded.

Anti-farming per entity ​

Property anti_farming_per_entity defines the anti-farming per entity for this experience source.

Anti-farming per chunk ​

Property anti_farming_per_chunk defines the anti-farming per chunk for this experience source.

Operations ​

Get Player ​

Operation get_player returns minecraft:player prototype.

Get Weapon Item Stack ​

Operation get_weapon_item_stack returns minecraft:item_stack prototype.

Get Damaged Living Entity ​

Operation get_damaged_living_entity returns minecraft:living_entity prototype.

Get Dealt Damage ​

Operation get_dealt_damage returns puffish_skills:number prototype which represents the amount of dealt damage.

Get Damage Source ​

Operation get_damage_source returns minecraft:damage_source prototype.

Example ​

The following experience source gives a player experience value equal to 25% of damage dealth.

Click to view
json
{
	"type": "puffish_skills:deal_damage",
	"data": {
		"variables": {
			"damage": {
				"operations": [
					{
						"type": "get_dealt_damage"
					}
				]
			}
		},
		"experience": "damage * 0.25"
	}
}

This experience source gives player 10 experience if an entity is killed with a diamond sword.

Click to view
json
{
	"type": "puffish_skills:deal_damage",
	"data": {
		"variables": {
			"damage": {
				"operations": [
					{
						"type": "get_weapon_item_stack"
					},
					{
						"type": "puffish_skills:test",
						"data": {
							"item": "diamond_sword"
						}
					}
				]
			}
		},
		"experience": "10"
	}
}