Use custom "minecraft" blocks (through behaviour/resource pack) in the MakeCode editor

I have made a custom Minecraft block called “poor_dirt”. Can i target this block in the Makecode editor in the block selection.
For example so i can say

if (blocks.testForBlock(POOR_DIRT, player.position())) {
    player.say(":)")
}

Or something like that?

1 Like

Welcome, @brammie15!

I don’t quite understand what you mean by “target this block”? It seems to be going beyond just using/referencing your custom block in a MakeCode program?

What i mean is i just want to be able get said block in testForBlock operations
basically one of these blocks
image
But than for example POOR_DIRT

You should be able to reference that block using blocks.blockByName("poor_dirt"). You could also use an extension and add a new reporter block that calls that method.

don’t think thats possible like that. :disappointed_relieved:

Try including the identifier, like myaddon:poor_dirt. It should be the same as when you give yourself the block with /give. I’m not sure if it will work, but it’s worth a try.

Also tried that (forgot to update previous post) and still no luck. :pensive: