How can I make an item display fake CanPlaceOn/CanDestroy data?

1.14 makes this possible without having to modify the language files.

The answer lies in the item's lore.

The lore text is displayed on the item's hover text. And with 1.14, you can now style your lore text using JSON text components, meaning you can make your lore text look just like the CanPlaceOn list.


For these advanced commands, I recommend using a command generator to get your command right and avoid NBT syntax errors.

  1. Set the HideFlags NBT tag to hide AttributeModifiers, Unbreakable, and the CanPlaceOn and CanDestroy list. These items will be shown below the lore if not hidden.
    The number you need is 30 to hide just these four.
  2. Set the Lore tag to the following lines:
    1. An empty line. This empty line needs to be in place so that a space is displayed between the item name and the fake block list for CanPlaceOn. This is because this space appears when genuinely using the real l.ist.

    2. The heading for the CanPlaceOn list.

      [{"text":"Can be placed on:","color":"gray","italic":false}]
      
    3. Your first fake list item. Replace Stone with the block name.

      [{"text":"Stone","color":"dark_gray","italic":false}]
      
    4. Your second fake list item. Repeat with any other items you want to add to the fake list.

      [{"text":"Gold Block","color":"dark_gray","italic":false}]
      
  3. Add the real items to the CanPlaceOn list using the normal tags. Don't worry about it showing, because you already hid it using step 1.