1
Setblock Help
Hey, I'm trying to create a game where players can break certain blocks (that a command block will summon). So how can I make things so that once the player has broken them, and collect them, so that the blocks can only be placed on certain other blocks?
(In my case, set a block to red wool that can only be placed on orange glass, and set a block to blue wool that can only be placed on blue glass.)
Thanks!
(In my case, set a block to red wool that can only be placed on orange glass, and set a block to blue wool that can only be placed on blue glass.)
Thanks!
Create an account or sign in to comment.
4
1
You can try a set of four command blocks that does this:
sets the scoreboard value of a player when they have the specific color of wool that isn't name something special so it's traceable in their inventory (The blocks that are the ones to actually be placed down should be named something to differentiate them)
then when the player has that scoreboard, clear one of that wool from their inventory
then using the same scoreboard requirements, give them one of the special wool with the data tag for placing only on certain blocks
after that, simply have a command block that sets their scoreboard value back to 0
these should be run in quick succession in this order to quickly take and give the wool from the player.
I hope this idea at least helps, or you can do what jmal said and use entitydata on any item that is the dropped wool and give it the data tag for only being placed on certain types of blocks.
sets the scoreboard value of a player when they have the specific color of wool that isn't name something special so it's traceable in their inventory (The blocks that are the ones to actually be placed down should be named something to differentiate them)
then when the player has that scoreboard, clear one of that wool from their inventory
then using the same scoreboard requirements, give them one of the special wool with the data tag for placing only on certain blocks
after that, simply have a command block that sets their scoreboard value back to 0
these should be run in quick succession in this order to quickly take and give the wool from the player.
I hope this idea at least helps, or you can do what jmal said and use entitydata on any item that is the dropped wool and give it the data tag for only being placed on certain types of blocks.
1
Both of the above issues are true. As well, normal blocks (like wool) lose all data tags when placed in the world, so the player destroying them would simply give them a normal wool block.
The only real workaround I can think of would be to change the data of the block when the player has already destroyed the block, maybe you could target the item entity right as the block is destroyed with the /entitydata command. You'll also have to use something besides different colors of glass, since you can't target specific damage values with CanPlaceOn.
The only real workaround I can think of would be to change the data of the block when the player has already destroyed the block, maybe you could target the item entity right as the block is destroyed with the /entitydata command. You'll also have to use something besides different colors of glass, since you can't target specific damage values with CanPlaceOn.
1
I don't think it's possible to specify data values with the CanPlaceOn tag. Nor is the CanPlaceOn tag used with the setblock command.
1
im confused. Are you trying to say that you need help getting custom tile drops?
Click to reveal