1

Minecraft Function

MainC1cak's Avatar MainC1cak12/30/17 8:56 am
1 emeralds 201 4
12/30/2017 8:32 pm
MainC1cak's Avatar MainC1cak
i have a function with some command inside it

execute as @s at @s run tp @s ^ ^ ^0.05
scoreboard players add @s tmp 1
tag @e[type=!area_effect_cloud,distance=..10] add hit
execute if score @s tmp < @s gun run function gunmech:move
scoreboard players set @s tmp 0

the "tag @e[type=!area_effect_cloud,distance=..10] add hit" command didn't do his thing even when there's so much mob around him
this function run 107 times every tick
maybe anyone could help?
Posted by MainC1cak's Avatar
MainC1cak
Level 1 : New Miner
0

Create an account or sign in to comment.

4

ShelLuser
12/30/2017 11:20 am
Level 57 : Grandmaster Engineer
ShelLuser's Avatar
First of all keep well in mind that snapshots are just that. When something doesn't work it could just as well be caused by a bug or something. Speaking of which: I think you should have mentioned that you're using a snapshot. Players who'd try this command on the currently recent version would get some pretty specific errors ;)

Anyway... How do you execute the function? If you want a specific entity to run a command inside your function then it's best to use the execute @s command.

So: execute as @s run tag @e[type... etc.
1
MainC1cak
12/30/2017 12:08 pm
Level 1 : New Miner
MainC1cak's Avatar
actually, the entity that i want to give tag is the different entity with the one that executing the function
1
ShelLuser
12/30/2017 6:39 pm
Level 57 : Grandmaster Engineer
ShelLuser's Avatar
I'm aware. Which is also what that execute command would do; the command would run as the entity, but it will tag others.

Also, I just realized the obvious (sorry, I'm slow sometimes) didn't you mean:

scoreboard players tag @e[stuff...] add hit?

Even so.. it would probably still be better to use execute as @s.

Hope this can help!
1
MainC1cak
12/30/2017 8:32 pm
Level 1 : New Miner
MainC1cak's Avatar
thanks, i will try and it stilll can't get what i want, i'll try other things
1
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome