How do I check the players gamemode with block code?

Started by Help_Me_Please on Sun, 05/20/2018 - 18:01

Topic category: Help with MCreator software

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

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • MCreator plugins:
  • Comments:
How do I check the players gamemode with block code?
Sun, 05/20/2018 - 18:01

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 00:21, 11. Aug 2019
Joined Aug 2013
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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 19:12, 29. Nov 2020
Joined Jun 2016
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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
User points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • Tracker tickets:
  • 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?