How to create a /god command

Started by InnohVateur on

Topic category: Help with modding (Java Edition)

Last seen on 17:42, 21. Jul 2022
Joined Jul 2022
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How to create a /god command

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 ?

Last seen on 08:50, 22. Apr 2023
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
so first you need to create…
Wed, 07/20/2022 - 23:58

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.

Last seen on 08:50, 22. Apr 2023
Joined Mar 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
uhh it seems to have not…
Thu, 07/21/2022 - 00:04

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.