#Part Of a Function Not executing while another part is.

1 messages · Page 1 of 1 (latest)

ivory finch
#

Hello,
I am making another post about this issue becuase I couldnt get clarity on the last one.
I wanted to summon a mob that would start raycasting at the nearest player, and then repeat that evey second as a rapid fire attack. In order to get this to trigger, but not trigger repeatedly, I summoned the mob with the tags "Mage" and "uncasted"

In tick.mcfunction I have the following command:

execute as @e[tag=uncasted] run function tower:initialize_mage

in the function tower:intialize_mage i have the following commands:

scoreboard players add @s raycast_mage 20
tag @s remove uncasted

raycast_mage is a score that goes down by 1 per tick and then begins the raycast process when it hits 1

It dosent work, however, and when I try to get the value of the raycast_mage score, the game responds that it cant do that because no score is set.
I then try to kill all entites with the tag "uncasted", thinking that if the function didnt execute, then it would still have the tag, but the game responds saying there are no entities with that tag.

I am confused about why one of the commands is running but the other isnt. I have checked for any place the tag could have been removed and there is none, and no place the entity could have been removed from the scoreboard. If anyone has any insight that would be great.

hushed moss
#

Did you add the scoreboard objective?

ivory finch
#

I have in the load.mcfunction file: scoreboard objectives add raycast_mage dummy

ivory finch
# hushed moss Did you add the scoreboard objective?

do you know if there is a better method to doing this? I want to be able to execute raycasts from a entity that came from a spawner, which is why I dont just execute the scoreboard adding in the same fuction as a summon command and use that function to summon the creature, which has previously worked for me

smoky pumice
#

and also, you should check if you written the tag in the spawner right