Started by
InnohVateur
on
Topic category: Help with Minecraft modding (Java Edition)
Hi !
I'm actually trying to create /god command which disable every damages for the player who wrote this command.
I tried many ways to make it but I failed every time (I found a bloc to diable damage but it doesn't work...)
Can someone give me the solution for this problem ?
so first you need to create a global variable with a name like "godmodeEnabled" and set its variable type to "logic" and its variable scope to "PLAYER_PERSISTENT"
then you need to create a command (you can name it whatever you want) that runs a procedure similar to this one:
pretty self-explanatory what this one does.
and then you need to make another procedure that's like this:
make sure that you set the global trigger thing at the top there to "Entity attacked" because if you don't, this procedure will do nothing.
also, even though the trigger only says "Entity attacked" it actually seems to cancel all damage from all sources, including /kill.
and that should be it, let me know if you have any problems or questions.
uhh it seems to have not sent the screenshots i put in there.
https://imgur.com/a/USG6Osh
that's a link to all the screenshots. sorry for the inconvenience.