How to prevent a player from sneaking while on a specific block

Started by RoboMan on

Topic category: Help with Minecraft modding (Java Edition)

Active 2 years ago
Joined Oct 2021
Points:
562

User statistics:

  • Modifications: 0
  • Forum topics: 8
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 15
How to prevent a player from sneaking while on a specific block

I have a custom block, and I do not want players to be able to sneak while on the block. How would I make it so that they cannot sneak while on this block?

Active 3 years ago
Joined Sep 2021
Points:
541

User statistics:

  • Modifications: 2
  • Forum topics: 0
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 9
Wow, this was harder than…
Thu, 10/07/2021 - 09:37

Wow, this was harder than expected

Trigger on walk, set sneak to false. Didn't work. (had to start with the basics lol)

Reduce bounding box y->15 (ala soul sand). Trigger on collide: set sneak to false. Didn't work

On Player Update: If block at x y-0.5 z = NoSneakBlock: set sneak to false. Still Didn't work

Active 2 years ago
Joined Oct 2021
Points:
562

User statistics:

  • Modifications: 0
  • Forum topics: 8
  • Wiki pages: 0
  • MCreator plugins: 0
  • Comments: 15
Apologies, but I have found…
Sat, 10/09/2021 - 21:59

Apologies, but I have found a different way entirely to solve this issue. I was able to use the radius function and it worked perfectly. Thanks you for trying to help, though!