# Creating an multi handler function in an extension

**URL:** <https://forum.makecode.com/t/creating-an-multi-handler-function-in-an-extension/10069>\
**Category:** PXT\
**Created:** [September 16, 2021, 10:32pm UTC](https://forum.makecode.com/t/creating-an-multi-handler-function-in-an-extension/10069 "2021-09-16T22:32:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ronzi](https://avatars.discourse-cdn.com/v4/letter/r/4bbf92/32.png) [@Ronzi](https://forum.makecode.com/u/Ronzi)\
**Post date:** [September 16, 2021, 10:32pm UTC](https://forum.makecode.com/t/creating-an-multi-handler-function-in-an-extension/10069/1 "2021-09-16T22:32:27Z")

</div>

Hello everyone, I am trying to create a new block using an extension. I want the block to handle more the one handler, an example for it can be the if+else block in the logic section.

\*At first I need it to handle only 2 handlers(like if+else), but it would be even better if it was expandable(like the if).

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

Does anyone know how to make it happen?  
\*A code of the “if” block by MakeCode would help me a lot.

Thank you.
