Skip to content

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

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?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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