# Making my own block that has a body and is not a top block

**URL:** <https://forum.makecode.com/t/making-my-own-block-that-has-a-body-and-is-not-a-top-block/2347>\
**Category:** PXT\
**Created:** [June 8, 2020, 9:35pm UTC](https://forum.makecode.com/t/making-my-own-block-that-has-a-body-and-is-not-a-top-block/2347 "2020-06-08T21:35:55Z")\
**Posts on this page:** 1\
**Showing post:** 6

<div class="post-metadata">

**Author:** ![richard](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/richard/32/5417_2.png) [@richard](https://forum.makecode.com/u/richard)\
**Post date:** [June 8, 2020, 10:46pm UTC](https://forum.makecode.com/t/making-my-own-block-that-has-a-body-and-is-not-a-top-block/2347/6 "2020-06-08T22:46:18Z")

</div>

Also, I should mention, generally it’s best to do APIs that take in non-primitives inside of `libs/` instead of in the simulator. Then you don’t have to deal with internals directly like this. For example, you could have an API in the simulator like this:

```auto
//%
export function addBlock(block: string) {
    board().addBlock(block)
}

```

and then define the public function in the libs folder like this:

```auto
//% blockId=subtract_shapes block="subtract shapes" 
//% topblock=false
//% handlerStatement=true
export function subtractShapes(body: () => void): void {
    internalNamespace.addBlock("difference( <CHILDREN> )")
    body()
}

```

If you start the name of the internal function with an underscore (e.g. \_addBlock) then it won’t show up to the user in completions.

---

_[View the full topic](https://forum.makecode.com/t/making-my-own-block-that-has-a-body-and-is-not-a-top-block/2347)._
