3

I know that typing /give @p minecraft:redsstone_torch 1 0 {CanPlaceOn:["minecraft:grass"]} in the past used to give a player a redstone torch that can be placed on grass for adventure mode, but when I try doing that in the new 1.13 snapshot, it highlights the canPlaceOn section in red (meaning it won't work). Does anybody know how it is supposed to be typed in the new syntax?

2 Answers 2

2

The syntax has changed to:

/give <players> <item> <count>

where <item> is a combination of ID and NBT (for blocks it's similar, but with state in [] between ID and NBT). So your command is then:

/give @p minecraft:redstone_torch{CanPlaceOn:["minecraft:grass"]} 1

or alternatively with @s, no minecraft: in the IDs (since it's default anyway) and without count (since 1 is default):

/give @s redstone_torch{CanPlaceOn:["grass"]}

Bonus: Maybe you'll be interested in block tags (archive).

2
  • How would we define other states? like the type of dyes?
    – Devan S.
    Commented Jun 10, 2018 at 21:07
  • They have their own IDs now. For example cocoa beans are no longer "dye 3", but instead just "cocoa_beans". What was once metadata is now either block states (for blocks, like /setblock ~ ~ ~ dispenser[facing:up]), NBT (mainly for tools, like /give @s diamond_axe{Damage:1}) or separate IDs. Commented Jun 11, 2018 at 12:51
0

In 1.12 and earlier <grass> was grass block. Now you need write grass_block like that:

/give @s redstone_torch{CanPlaceOn:["grass_block"]}

Because now "minecraft:grass_block" is real block, if you try

/setblock ~ ~ ~ grass

You place grass, not block.

I think he want this, because its impossible to place in grass redstone torch.

(sorry if i somewhere made mistake, my english is pretty bad)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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