block_entity_data component

How do I get a barrel item with a custom block name which is different to the name of the item? This is the command I use: /give @s minecraft:barrel[minecraft:block_entity_data={id:"minecraft:barrel",CustomName:'{"text":"hello"}'}]

Continue to help post