Started by
lanto
on
Topic category: Help with Minecraft modding (Java Edition)
Hi! I'm trying to make a mob become invisible for a few seconds after receiving damage.
I made the entity run a procedure when hurt, inside the procedure I added effect give @s invisibility 1 1 true but it doesn't do anything. I tried using other commands in its place as a test and they work, so i concluded that the problem is the targeting.
If @s doesn't work, what do i use?
Edited by lanto on Fri, 05/13/2022 - 16:33
Entity Management tab ->
Add potion with level [0] for [60] ticks to [event/target entity] type [invisibility]
You could also, instead of using a command, in the search bar type → potion and then select the one that says Add potion, and then select the Invisibility effect. The first number is the strength of the potion, which doesn't really matter when it comes to invisibility, and the second number is how long is will last for.
Whoops I didn't see @Valirane reply, If you absolutely want to use a command then make sure you use the one thats labeled "Execute command in the name of" under entity managment, if the trigger is "When entity is hurt" make sure to use EventEntity and not SourceEntity.