# Inventory extension

**URL:** <https://forum.makecode.com/t/inventory-extension/8662>\
**Category:** Show & Tell\
**Tags:** extension\
**Created:** [June 9, 2021, 11:29pm UTC](https://forum.makecode.com/t/inventory-extension/8662 "2021-06-09T23:29:04Z")\
**Posts on this page:** 14\
**Page:** 4

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [July 8, 2024, 5:24pm UTC](https://forum.makecode.com/t/inventory-extension/8662/67 "2024-07-08T17:24:59Z")

</div>

It seems to be working just fine for me, but when I first opened the game there was a black screen for a couple of seconds. Can you describe what is happening?

* * *

Sorry it took so long to respond, I was on vacation lol.

---

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [February 19, 2025, 6:40pm UTC](https://forum.makecode.com/t/inventory-extension/8662/68 "2025-02-19T18:40:02Z")

</div>

could you add an add item to inventory to it that would really simplify my game

---

<div class="post-metadata">

**Author:** ![PortingPlayTimeCO](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/portingplaytimeco/32/23594_2.png) [@PortingPlayTimeCO](https://forum.makecode.com/u/PortingPlayTimeCO)\
**Post date:** [April 7, 2025, 2:33am UTC](https://forum.makecode.com/t/inventory-extension/8662/69 "2025-04-07T02:33:46Z")

</div>

how do you make usable items? not like the eating thing but like using it, i was wanting to use it so you can equip tools and weapons if your holding it in your toolbar, i also wanted to know how do you make it so that it will update a variable with the number of the item held?

---

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [April 7, 2025, 3:24am UTC](https://forum.makecode.com/t/inventory-extension/8662/70 "2025-04-07T03:24:04Z")

</div>

also a icon like this would be nice al you need to do is paste this after the color `icon="\uf187"`

---

<div class="post-metadata">

**Author:** ![UnsignedArduino](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/unsignedarduino/32/592_2.png) [@UnsignedArduino](https://forum.makecode.com/u/UnsignedArduino)\
**Post date:** [April 7, 2025, 3:44am UTC](https://forum.makecode.com/t/inventory-extension/8662/71 "2025-04-07T03:44:46Z")

</div>

> [@CodeOnTheCob](#):
>
> could you add an add item to inventory to it that would really simplify my game

You should look at the example code I’ve posted to see how I used a function to add an item. Although I wouldn’t be the first to concede that this extension is very basic - I think a new version is due.

> [@PortingPlayTimeCO](#):
>
> how do you make usable items? not like the eating thing but like using it

Check the name of the selected item in the toolbar on A pressed, or something similar. This extension is very primitive as I mentioned.

> [@PortingPlayTimeCO](#):
>
> i also wanted to know how do you make it so that it will update a variable with the number of the item held?

Check the example code.

---

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [April 7, 2025, 5:07pm UTC](https://forum.makecode.com/t/inventory-extension/8662/72 "2025-04-07T17:07:30Z")

</div>

oh yah I figured out how to do that a while ago thank tho

---

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [April 7, 2025, 6:43pm UTC](https://forum.makecode.com/t/inventory-extension/8662/73 "2025-04-07T18:43:39Z")

</div>

use a custom icon instead please like this box icon it would look so good

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/3/6/369dbdc55282e2c98df27c4d10ed870546274679.png)

---

<div class="post-metadata">

**Author:** ![CodeOnTheCob](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codeonthecob/32/19306_2.png) [@CodeOnTheCob](https://forum.makecode.com/u/CodeOnTheCob)\
**Post date:** [April 8, 2025, 9:57pm UTC](https://forum.makecode.com/t/inventory-extension/8662/74 "2025-04-08T21:57:01Z")

</div>

![inentory-with-icon](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/5/d55d8acd407f087cbce6aaa2faa2069275202a55.png)  
import this instead of the og it just has incon for it in the blocks toolbar on the left

---

<div class="post-metadata">

**Author:** ![PortingPlayTimeCO](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/portingplaytimeco/32/23594_2.png) [@PortingPlayTimeCO](https://forum.makecode.com/u/PortingPlayTimeCO)\
**Post date:** [April 8, 2025, 11:33pm UTC](https://forum.makecode.com/t/inventory-extension/8662/75 "2025-04-08T23:33:25Z")

</div>

i use the inventory system like the example but when i try to get debug to see which item is currently held it wont work and gives me errors. im trying to make a tool system with this

---

<div class="post-metadata">

**Author:** ![Stickman4269](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/stickman4269/32/23582_2.png) [@Stickman4269](https://forum.makecode.com/u/Stickman4269)\
**Post date:** [April 13, 2025, 12:12am UTC](https://forum.makecode.com/t/inventory-extension/8662/76 "2025-04-13T00:12:18Z")

</div>

Can you adjust it so that if you increase the screen size using the userconfig method, it increases the amount of items per row or the size of the items and doesn’t go into the next row halfway across the screen

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [April 13, 2025, 2:48pm UTC](https://forum.makecode.com/t/inventory-extension/8662/77 "2025-04-13T14:48:41Z")

</div>

well actually thats kinda hard cos im not sure if theres a simple way to check for screen size changes. Makecode wasnt exactly optimised for that bit of code so you would expect it to be a little janky 🙃

---

<div class="post-metadata">

**Author:** ![WoofWoof](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/woofwoof/32/32523_2.png) [@WoofWoof](https://forum.makecode.com/u/WoofWoof)\
**Post date:** [April 13, 2025, 8:00pm UTC](https://forum.makecode.com/t/inventory-extension/8662/78 "2025-04-13T20:00:44Z")

</div>

Pretty sure there’s a screen size variable, somewhere in the scene/tilemap stuff. Also couldn’t you just read the variable? The constant that holds the screen size?

---

<div class="post-metadata">

**Author:** ![Stickman4269](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/stickman4269/32/23582_2.png) [@Stickman4269](https://forum.makecode.com/u/Stickman4269)\
**Post date:** [April 14, 2025, 2:54am UTC](https://forum.makecode.com/t/inventory-extension/8662/79 "2025-04-14T02:54:51Z")

</div>

![IMG_0164](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/6/86e39830b82d03ea7185435169be13747c4d6efa.jpeg)

---

<div class="post-metadata">

**Author:** ![Josef](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/josef/32/12457_2.png) [@Josef](https://forum.makecode.com/u/Josef)\
**Post date:** [April 14, 2025, 6:11pm UTC](https://forum.makecode.com/t/inventory-extension/8662/80 "2025-04-14T18:11:21Z")

</div>

ahhh yes i forgot lol

[Previous page](https://forum.makecode.com/t/inventory-extension/8662.md?page=3)
