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

**URL:** <https://forum.makecode.com/t/use-custom-minecraft-blocks-through-behaviour-resource-pack-in-the-makecode-editor/23502>\
**Category:** Minecraft\
**Tags:** extension\
**Created:** [October 20, 2023, 10:42pm UTC](https://forum.makecode.com/t/use-custom-minecraft-blocks-through-behaviour-resource-pack-in-the-makecode-editor/23502 "2023-10-20T22:42:16Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![brammie15](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brammie15/32/11334_2.png) [@brammie15](https://forum.makecode.com/u/brammie15)\
**Post date:** [October 20, 2023, 10:42pm UTC](https://forum.makecode.com/t/use-custom-minecraft-blocks-through-behaviour-resource-pack-in-the-makecode-editor/23502/1 "2023-10-20T22:42:16Z")

</div>

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

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

```

Or something like that?

---

<div class="post-metadata">

**Author:** ![Vegz78](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/vegz78/32/1201_2.png) [@Vegz78](https://forum.makecode.com/u/Vegz78)\
**Post date:** [November 8, 2023, 5:52pm UTC](https://forum.makecode.com/t/use-custom-minecraft-blocks-through-behaviour-resource-pack-in-the-makecode-editor/23502/2 "2023-11-08T17:52:02Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![brammie15](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brammie15/32/11334_2.png) [@brammie15](https://forum.makecode.com/u/brammie15)\
**Post date:** [November 8, 2023, 10:29pm UTC](https://forum.makecode.com/t/use-custom-minecraft-blocks-through-behaviour-resource-pack-in-the-makecode-editor/23502/3 "2023-11-08T22:29:11Z")

</div>

What i mean is i just want to be able get said block in testForBlock operations  
basically one of these blocks  
 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/9/9c87eeb44250b1a4a8462130237b7b6c0bb4ba16.png)  
But than for example POOR\_DIRT

---

<div class="post-metadata">

**Author:** ![Amitai](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Amitai](https://forum.makecode.com/u/Amitai)\
**Post date:** [November 20, 2023, 11:29pm UTC](https://forum.makecode.com/t/use-custom-minecraft-blocks-through-behaviour-resource-pack-in-the-makecode-editor/23502/4 "2023-11-20T23:29:27Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brammie15](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brammie15/32/11334_2.png) [@brammie15](https://forum.makecode.com/u/brammie15)\
**Post date:** [November 21, 2023, 6:16pm UTC](https://forum.makecode.com/t/use-custom-minecraft-blocks-through-behaviour-resource-pack-in-the-makecode-editor/23502/5 "2023-11-21T18:16:05Z")

</div>

don’t think thats possible like that. 😥

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/2X/a/afbd6c9cd46671ce4287688c51bc87e9612e6d16.png)

---

<div class="post-metadata">

**Author:** ![Amitai](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@Amitai](https://forum.makecode.com/u/Amitai)\
**Post date:** [November 22, 2023, 12:35am UTC](https://forum.makecode.com/t/use-custom-minecraft-blocks-through-behaviour-resource-pack-in-the-makecode-editor/23502/6 "2023-11-22T00:35:56Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![brammie15](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/brammie15/32/11334_2.png) [@brammie15](https://forum.makecode.com/u/brammie15)\
**Post date:** [November 22, 2023, 7:04pm UTC](https://forum.makecode.com/t/use-custom-minecraft-blocks-through-behaviour-resource-pack-in-the-makecode-editor/23502/7 "2023-11-22T19:04:49Z")

</div>

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