0

I'm looking for a way to prevent placement of bedrock in survival. This may be achieved by an NBT TAG, a command block or else. If you know a /give command that will do the trick then that would be great.

A command block that destroys all bedrock is also okay.

I need this because I'm making a vanilla server that uses custom villagers as shops. However, the only thing you can't obtain in Minecraft is bedrock, so I will be using it as the currency. I need to make sure it is unbreakable though, so nobody will build a house out of bedrock or do something else of the sort.

4
  • Please do not give a summon command for villagers with a custom trade including implacable bedrock. THAT IS NOT THE QUESTION.
    – Roke
    Oct 4 '15 at 19:34
  • 1
    I know this doesn't directly answer the question, but there are plenty of other things you can't obtain in survival which would be less troublesome than giving players bedrock. For example, farmland, lit_furnace, or an empty spawn egg.
    – SirBenet
    Oct 4 '15 at 19:54
  • If you run server with plugins, you can use WorldGuard, which can effectively blacklist usage/placing of said items. Oct 5 '15 at 8:12
  • We used to use spawn eggs as voting reward some time ago to collect and trade them in. They should cause you much less of a headache than bedrock.
    – dly
    Oct 5 '15 at 10:00
2

Ok this might not be the best answer but I was thinking of running a command 20 ticks a second.

/execute @p ~ ~ ~ /fill ~7 ~7 ~7 ~-7 ~-7 ~-7 air 0 replace bedrock

This would work but it would also delete bedrock that the player has not placed i.e naturally spawned in bedrock.

Another method that I was thinking was to set the player in Gamemode 2 whenever he is holding bedrock in his hand, for example:

/testfor @p {SelectedItemSlot:(changable),Inventory:[{Slot:(changable)b,­id:"minecraft:bedrock"}]­}

Then make that flow into a command block that makes the player in adventure mode then a redstone torch that changes the player back into the original mode.

Hope it helped

1
  • 2
    There are severe problems with your command. @p won't cut it, you need to know exactly who is holding the item, meaning you'll need to set a scoreboard objective (or use 1.9s scoreboard tags). Furthermore, a "redstoneless" version using a setblock clock is better for lag. Lastly, testing for an item in hand can be done directly via SelectedItem, otherwise you'll need a command for every hotbar slot.
    – MrLemon
    Oct 7 '15 at 14:52

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.