How do I use block IDs in WorldEdit for Minecraft?

When I type:

//set 7271

To change it to a modded block, it says 7271 isn't a valid block name.

Is there any way I can make it understand block IDs?


That's because, well, 7271 isn't a valid block name. In fact, it doesn't refer to anything at all in vanilla Minecraft. Additionally, even if it does refer to a mod-related ID, that would be an item ID, not a block ID, and WorldEdit doesn't always play too nice with mods.

If you need a list of block IDs, you can check the wiki here.


The issue here is because you're using the item ID of the block, not the block ID. WorldEdit works fine when using the block IDs, but not the item IDs (as there's no way to determine what block it's attached to).

There are a few ways to get around this, however, such as using WorldEdit's /info tool to grab the block ID, or copying the block and using #clipboard instead of the ID.

Source: WorldEdit Developer. More info @ https://madelinemiller.dev/blog/worldedit-mod-blocks/