Started by
Paulypus
on
Topic category: Help with Minecraft modding (Java Edition)
I would like to, for the purpose of making a dungeon with things such as a maze and parkour, make the player unable to place or break blocks in an area while still allowing the player to interact with things such as chests. If anyone knows how to do this, the help is greatly appreciated.
You could make a new, unbreakable block to build it out of to avoid the walls/puzzles from being broken (it could even be visually identical to a vanilla block if so desired). You could then make a 'on neighbor block update' procedure which sets the block back to air (though it would take a bit more work to return this block to the player's inventory if that's desired, albeit still probably possible).
When they're in that certain area change their gamemode to Adventure
I may use the method of adding a new block, but for now I'm just going to leave it as-is and the player can cheat on the puzzles and such if they don't like fun
I have a solution.
Create two procedures, with global triggers block broken or block placed
Then, add one custom block somewhere in the dungeon (this block has to get destroyed at the end if you want the dungeon to become editable)
For both procedures, have it check if the player who did it is in proximity to the dungeon block above. If yes, then cancel the global trigger.
You could replace proximity to a custom block with some other way of testing if the player is in the dungeon, but the general idea is global triggers and then canceling.
Option 2 is mining fatigue plus the above solution to prevent placement of blocks
Hi! I have a question, and I can't dm so I had to put it here, really sorry abt that. But, on this post: https://mcreator.net/forum/62963/be-immune-lightning-player?page=1 you made a comment and said you were able to do this for different damage types. I was just wondering how you were able to figure this out? Like I tried changing it from DamageSource.LIGHTNING_BOLT to DamageSource.TRIDENT but that didn't work, so I was hoping you could lemme know please. Thanks, and sorry again for the irrelevant comment!