How do I check the players gamemode with block code?

Started by Help_Me_Please on

Topic category: Help with MCreator software

Last seen on 21:12, 23. Nov 2018
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do I check the players gamemode with block code?

I'm trying to do something really simple.  If the player is in creative then when they use a one use item I made then it won't delete it from the inventory.  In survival it is a one use item and will get deleted.  No block code seems to have get or detect gamemode, so how would I do this?

Last seen on 17:17, 10. Jan 2024
Joined Aug 2013
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
You could access…
Tue, 05/22/2018 - 22:24

You could access EntityPlayer#capabilities , and there get the field "isCreativeMode" , or I believe that there are now even in the EntityPlayer class methods isCreative() and isSpectator().

Last seen on 17:49, 25. Mar 2021
Joined Jun 2016
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is a block in the…
Wed, 05/23/2018 - 05:37

There is a block in the player section that checks gamemode  (if I remember well)

Last seen on 21:12, 23. Nov 2018
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
There is a block that sets…
Sat, 05/26/2018 - 21:04

There is a block that sets the player's gamemode, but none to set it.

Last seen on 21:12, 23. Nov 2018
Joined May 2018
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I don't see an entity player…
Sat, 05/26/2018 - 21:08

I don't see an entity player tab in the left side of procedures.  How would I do this with block code please?