Skip to content

a way of getting the target of parent entity from the child entity #49

@jLn0n

Description

@jLn0n

currently, im struggling doing this:

asat(@a) {
	var slimeKilled @s = 0

	if ('entity @s[nbt={SelectedItem:{id:"minecraft:stick",Count:1b}}]') {
		raycast(10, "air", entity @e[type=slime]) {
			/kill @s
			slimeKilled @s = 1 // @s points to the raycasted entity instead of parent entity (player)
		}
		if (slimeKilled @s == 1) {
			/say Oops, you killed a slime (accedentally).
			slimeKilled @s = 0
		}
	}
}

is there a way of getting the player?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions