3

I need help

Loweredgames's Avatar Loweredgames7/26/18 7:52 am
8/18/2018 7:18 pm
Loweredgames's Avatar Loweredgames
hi I'm creating a map, this map uses the adventure mode, I have to destroy the red stone with a named object, but when the object becomes an item can no longer be placed, you explain it? I have already used excute but it does not work Please answer me.
Posted by Loweredgames's Avatar
Loweredgames
Level 51 : Grandmaster Artist
45

Create an account or sign in to comment.

15

3
07/27/2018 12:27 am
Level 29 : Expert Engineer
SUPERIONtheKnight
SUPERIONtheKnight's Avatar
K, so it sounds like that the problem you are having is with placing the block once it is mined? We can fix this with a quick /execute data merge command.
/execute as @e[type=item,nbt={"Item":{"id":"minecraft:redstone_block"}}] run data merge entity @s {"Item":{"tag":{"CanPlaceOn":["minecraft:stone"]}}}
So how does this work? Pretty simple actually, we start with executing as any redstone_block item using the following selector: @e[type=item,nbt={"Item":{"id":"minecraft:redstone_block"}}]
Next, we merge the data with itself(@s) telling it that it can be placed on any stone block. :)

You can easily allow it to be placed on more blocks by adding ,"minecraft:<blockname>" after the stone argument we already specified. So for example, I want to also be able to place it on dirt.
/execute as @e[type=item,nbt={"Item":{"id":"minecraft:redstone_block"}}] run data merge entity @s {"Item":{"tag":{"CanPlaceOn":["minecraft:stone","minecraft:dirt"]}}}
Obviously, the block names should be replaced with whatever block you are wanting to use. You can see the correct block id while hovering your mouse over an item if advanced tooltips is enabled. This is done with F3 + H.

I hope this helped! :)
~SUPERIONtheKnight
2
07/29/2018 4:00 pm
Level 51 : Grandmaster Artist
Loweredgames
Loweredgames's Avatar
sorry, but you can add another id

example: {"Item": {"id": "minecraft: redstone_block, minecraft: stone"}}}]

if I was wrong, I explained it to him.
3
08/11/2018 2:20 amhistory
Level 29 : Expert Engineer
SUPERIONtheKnight
SUPERIONtheKnight's Avatar
First off, My apologies for the late reply. For whatever reason, PMC didn't notify me about your other replies. I noticed them when I was looking through some of my older forum posts.

Also I don't understand, Do you want to add more id's into the selector? This isn't possible, and you would be better off with adding an additional command that uses a different id.
/execute as @e[type=item,nbt={"Item":{"id":"minecraft:redstone_block"}}] run data merge entity @s {"Item":{"tag":{"CanPlaceOn":["minecraft:stone","minecraft:dirt"]}}}/execute as @e[type=item,nbt={"Item":{"id":"minecraft:lapis_block"}}] run data merge entity @s {"Item":{"tag":{"CanPlaceOn":["minecraft:stone","minecraft:dirt"]}}}
To explain why it isn't possible to do this in a single command, we need to understand how Minecraft reads Data Tags which is in "attribute:value" pairs. As an example, you might want to silence a villager with the "Silent" attribute. In this case, the value needed is a byte(b), and it should be either true(1) or false(0). As such, using either 0b or 1b for the value will work. You might also want the villager to be a baby, so you would want to set the "Age" attribute to a negative number like -1000(Note: No letter is added to Age's value as it is an Integer). Using this knowledge, the following command will summon a silent baby villager.
/summon villager ~ ~ ~ {"Silent":1b,"Age":-1000}
If you don't know what kind of value is needed for a certain attribute, or if you want to know about your other options in general, I highly recommend looking up the block/entity that you are using on the Minecraft Wiki. The resulting page should have what you are looking for if you scroll down a little bit.
Another option is to use the /data get command which will provide you with a list of every data tag the block/entity has.
/data get entity @e[type=minecraft:MOBHERE,sort=nearest,limit=1]/data get block x y z
With all of that said, we can finally understand why the original command won't work by itself.
  • The "CanPlaceOn" attribute uses an array as its value. Arrays are defined with square brackets([]) and are capable of having a list inside of it. In this particular case, it uses a list of blocks."CanPlaceOn":["minecraft:stone","minecraft:dirt","minecraft:podzol"]


  • "id" does NOT use an array as its value. As such, it can not have a list of blocks."id":"minecraft:stone"


Now you might be thinking that you could use "id" multiple times, just like the following.
"id":"minecraft:stone","id":"minecraft:dirt","id":"minecraft:podzol"
While you can do this, it still won't work. If Minecraft sees that there are multiple of the same attribute, it will simply use the one that is the furthest to the right(In this case, the id using podzol). So the above example might as well be reduced to the following.
"id":"minecraft:podzol"
There are exceptions to this, particularly depending on whether the same tag is inside of a separate compound({}). However in general, the duplicate tag furthest to the right is what will be used.

I hope this helps! :)
~SUPERIONtheKnight
3
08/18/2018 7:18 pm
Level 51 : Grandmaster Artist
Loweredgames
Loweredgames's Avatar
thans
2
07/29/2018 2:45 pm
Level 51 : Grandmaster Artist
Loweredgames
Loweredgames's Avatar
you saved me the map, really thank you
3
07/29/2018 2:30 pm
Level 51 : Grandmaster Artist
Loweredgames
Loweredgames's Avatar
thans you
3
07/26/2018 10:54 pmhistory
Level 42 : Master Technomancer
Giancarlovan
Giancarlovan's Avatar
What about this :

/kill @e[type=item]


Make it so that when the redstone block breaks, that command runs to kill the dropped item.

I'm not too sure what you're trying to do though, could you explain what you wanted to happen?
2
07/26/2018 3:22 pm
Level 33 : Artisan Creeper Hugger
AgentShieldjj
AgentShieldjj's Avatar
give @p minecraft:diamond_pickaxe 1 0 {CanDestroy:["wood","stone"],display:{Name:Scout}}

1.12.2
this worked for me
plz give more info to thankyou
2
07/26/2018 4:04 pm
Level 51 : Grandmaster Artist
Loweredgames
Loweredgames's Avatar
thans but no
2
07/26/2018 3:18 pm
Level 33 : Artisan Creeper Hugger
AgentShieldjj
AgentShieldjj's Avatar
is it 1.12.2 or 1.13
2
07/26/2018 4:04 pm
Level 51 : Grandmaster Artist
Loweredgames
Loweredgames's Avatar
1.13
2
07/26/2018 4:39 pm
Level 51 : Grandmaster Artist
Loweredgames
Loweredgames's Avatar
I'm sorry too, maybe if you can give me a site I have something like that, otherwise I do not know how to do the command.
2
07/26/2018 4:14 pm
Level 6 : Apprentice Engineer
TobyTapper
TobyTapper's Avatar
Sorry I don't do 1.13, afraid your on your own. Sorry.
4
07/26/2018 12:03 pm
Level 6 : Apprentice Engineer
TobyTapper
TobyTapper's Avatar
It's been a while since I played with this so I don't remember the commands, but I think the block looses it's tags when changing to an entity, so I'll give two options.

1. If blocks do not lose data when mined, just give the block a "can be placed on" tag.

2.If above is false, use a repeating command block to test for the block in the players inventory, (you'll have to Google that), then add a condition chain block to remove the block without tags, and a unconditional chain block after that to give the same block back with tags.

If I wasn't clear, misread your issue, or you need more help please feel free to ask. -TobyTapper
1
07/26/2018 2:26 pm
Level 51 : Grandmaster Artist
Loweredgames
Loweredgames's Avatar
can you give me the command so I try?
Planet Minecraft

Website

© 2010 - 2024
www.planetminecraft.com

Welcome