1

So me and a bunch of buddies have a minecraft realm and have access to the nether too. We don't have any gamerules changed at this point but I (as the owner) got some complaints about losing items in the nether due to them burning in lava and Creepers blowing up the houses at spawn.

I can definitely see these things being annoying so I wanted to change some gamerules but not everywhere.

What I'm asking is, if it's possible to set gamerules based on location on realms? (I'm specifically saying realms because I know plugins like on servers could be a solution but because it's a realm I can't get those on there)

What I mean by that is if it's possible to turn on /gamerule keepInventory true only for the players in the nether and turn on /gamerule doMobGriefing false in a specific area. (maybe it's possible to do something like this with commandblocks)

I'm very grateful for any help or advice and thank you in advance.

  • I think this is only possible with mods.I'm not entirely sure though – Robbie Nov 7 at 13:47
3

It is possible for you to turn on /gamerule keepInventory true in the Nether, you must go there first before entering the command and it should, in theory, only apply that gamerule to the Nether, similarly with the End.

If you're working with Vanilla, there is no basic solution to having mob griefing off in a specific area. You can try looking for some command block commands online which may have a solution, that's if you're looking to use those. This might be what you're looking for: https://www.minecraftforum.net/forums/minecraft-java-edition/redstone-discussion-and/commands-command-blocks-and/2825763-how-to-disable-creeper-griefing-in-a-certain

  • Both sound like a good plan, I'll try them when I get home from work to see if they work, thank you for your answer though! – THess Nov 5 at 12:34
  • Okay, I came home and tested them and neither of them worked :/ – THess Nov 5 at 18:10
  • @Thess, do you have the privilege to give out bountys? – Lsootgamer13 Nov 7 at 16:59
  • @Lsootgamer13 eh, yes? I gave out the bounty so I have the privilege. Why? – THess Nov 7 at 22:53
  • It just says you have 50 rep – Lsootgamer13 Nov 7 at 23:22
0

You could use data merge entity @e[type=creeper,tag=!explosion0] {ExplosionPower:0,Tags:["explosion0"]} and run that in an ever-repeating command block to always target creepers with an explosion power of more than 0, or the ability to destroy blocks upon exploding. (May not be full answer but will get you most of the way through)

However, I am not very sure how to solve keepinventory in only the nether, however. It involves on a very long chain of commands that involve checking each inven slot of a player, storing it as a value in a scoreboard based on it's NBT and then give the player the items back based on a very long if/else chain of command blocks checking the scoreboard value of each slot and then decoding the scoreboard value of the item that you have set and then giving the player the specific item with the same NBT and other modifiers. That's the only method I know.

Basically, unless you use some kind of big brain thing like plugins or a creative mind which I don't have, it's impossible to turn on keepInventory for only the nether.

  • Thanks for your answer! Is there a way to do that command only to creepers in a certain location like I stated in the question? – THess Nov 11 at 9:06
  • Could you update your answer so I know where/how to do "run ```" ? – THess Nov 11 at 12:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.