Hi there! This is my first post here so apologies if I don't have the rules quite under my belt yet.
I am making a kit in a 1.8.9 kitpvp server that summons named wolves with a bone, and I wanna make it so the wolves are killed <) when the player dies or has their inventory cleared (I have it so selecting another kit also clears the inventory of a player). I have the spawning of the wolves down, but I just can't figure out how to kill them. I have tried a bunch of different things, but to no avail so far. Here is what I currently have:
Code (Script):
-on rightclick with a bone:
- name of player's tool is "&rDog Whistle"
- spawn a wolf 1 meter above the targeted block
- tame last spawned wolf to player
- heal last spawned wolf
- set the last spawned wolf's name to "&a%player%'s Wolf"
- spawn a wolf 1 meter above the targeted block
- tame last spawned wolf to player
- heal last spawned wolf
- set the last spawned wolf's name to "&a%player%'s Wolf"
- spawn a wolf 1 meter above the targeted block
- tame last spawned wolf to player
- heal last spawned wolf
- set the last spawned wolf's name to "&a%player%'s Wolf"
-on death:
- if name of a wolf is "&a%player%'s Wolf"
- kill wolf
-on command "/cleareverything":
- if name of a wolf is "&a%player%'s Wolf"
- kill wolf
I am making a kit in a 1.8.9 kitpvp server that summons named wolves with a bone, and I wanna make it so the wolves are killed <) when the player dies or has their inventory cleared (I have it so selecting another kit also clears the inventory of a player). I have the spawning of the wolves down, but I just can't figure out how to kill them. I have tried a bunch of different things, but to no avail so far. Here is what I currently have:
Code (Script):
-on rightclick with a bone:
- name of player's tool is "&rDog Whistle"
- spawn a wolf 1 meter above the targeted block
- tame last spawned wolf to player
- heal last spawned wolf
- set the last spawned wolf's name to "&a%player%'s Wolf"
- spawn a wolf 1 meter above the targeted block
- tame last spawned wolf to player
- heal last spawned wolf
- set the last spawned wolf's name to "&a%player%'s Wolf"
- spawn a wolf 1 meter above the targeted block
- tame last spawned wolf to player
- heal last spawned wolf
- set the last spawned wolf's name to "&a%player%'s Wolf"
-on death:
- if name of a wolf is "&a%player%'s Wolf"
- kill wolf
-on command "/cleareverything":
- if name of a wolf is "&a%player%'s Wolf"
- kill wolf