Trying to set player Gamemode within radius of a block.

Started by JohnJohnson on

Topic category: Help with Minecraft modding (Java Edition)

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Trying to set player Gamemode within radius of a block.

Hello, I'm fairly new to Mrcreator and I'm trying to find a solution to this procedure below. I want the player to bet set into Adventure mode if they leave a specified radius of this block. The only problem I'm having is specifying which player is switched. Thanks!

 

Event Trigger on Update tick

IF

-Does entitiy exist within square cube radius of type "player"

DO

-Set gamemode of nearest player within cube radius to Survival

ELSE 

-set gamemode Adventure

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
How do you want to specify…
Mon, 12/11/2023 - 09:23

How do you want to specify it?

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I'd like to specify it based…
Mon, 12/11/2023 - 16:30

I'd like to specify it based on individual Persistent Player profiles. That way it knows which player steps outside of the blocks radius. I made a global variable to call on persistent player's, but I couldn't get it to work in my parameter. Thanks for the reply!

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
Try using a potion effect,…
Mon, 12/11/2023 - 17:00

Try using a potion effect, if they are in it give it to them, and if they are out, and have the effect, change there gamemode.

Joined Dec 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I could give that a shot. My…
Mon, 12/11/2023 - 17:29

I could give that a shot. My main issue is calling on each individual player. The procedure for being "inside the cube radius" only specifies "Nearest Player" not "Player Persistent. I cant find a way to replace "Event/target/entity with an actual player. Hope that makes more sense

Joined Oct 2023
Points:

User statistics:

  • Modifications:
  • Forum topics:
  • Wiki pages:
  • MCreator plugins:
  • Comments:
I see. Do this, find player…
Mon, 12/11/2023 - 20:38

I see. Do this, find player in radius, set gamemode, give effect. Only do this if the player doesn't have the effect. Make the effect only stay for about a second. I think this works for what you are trying to do.