# \[Extension\] Array Stats extension

**URL:** <https://forum.makecode.com/t/extension-array-stats-extension/44888>\
**Category:** Arcade\
**Tags:** extension\
**Created:** [July 11, 2026, 8:55pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888 "2026-07-11T20:55:16Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 11, 2026, 8:55pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/1 "2026-07-11T20:55:16Z")

</div>

so I showed this and my other extensions on **[I need help with this](https://forum.makecode.com/t/i-need-help-with-this/35415)** but I thought it needed its own topic like a couple other of my extensions so…

NEW EXTENSION ARRAY STATS

> **[GitHub - NeverStopTheCoder/array-stats: this extension is for stuff like pokemon where you...](https://github.com/neverstopthecoder/array-stats)**
>
> this extension is for stuff like pokemon where you can create a pokemon stat list with these pokemon with there images or a number or a word

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

for stuff like pokemon

like what you start with is the create stat block fill it will say a string a image and a number (like pokemon name image and start level) and name it (the list input) like Pokemon the change block will change what’s in a stat the get stats from stat with name block will grab what’s in a stat name NOT the category name like Pokemon the stat it self like say Pikachu Bulbasaur Charizard it will return the whole thing like Pokemon|Pikachu|[object object] (the image cant really be put into text) |13

for

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

or

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/4/84bdcc5c074a8a64faaa1b31656e11ef1c08412d.png)

this will grab the stats of a random entry the plus at index 1 will grab the name or just the first thing in the array 0 gives the category/list name aka pokemon

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 18, 2026, 6:38pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/2 "2026-07-18T18:38:36Z")

</div>

any thing you guys whatching want to see?

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 18, 2026, 6:38pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/3 "2026-07-18T18:38:41Z")

</div>

like in a way you have to kinda first put a name as the stat name

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 18, 2026, 6:39pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/4 "2026-07-18T18:39:41Z")

</div>

update log:

July 18 2026:

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

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/d/9d38c5f294c5aaf937136b7bd42b3b7107875608.png)

there are now

1.better name working

2.you can have more than 3 things

3.and create and change round blocks for variables

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 19, 2026, 5:46pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/5 "2026-07-19T17:46:00Z")

</div>

update Log:

July 19 2026:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/1/91153c337d1a3cc6140daf16d89c6f6a983a687f.png)

added values category with

1.length of stats with name block that gives back the number (starting at 1) of inputs on that stats array

2.length of list with name block that gives back the length (starting at 1) of the stats in a list

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/5/d51c2ed9016c26415f728ea20903ad0072e83cf1.png)

3.added a get stat from last random picked stat block that grabs the last stat that the random block picked and grabs whatever is at the index

---

<div class="post-metadata">

**Author:** ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)\
**Post date:** [July 20, 2026, 2:31am UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/6 "2026-07-20T02:31:30Z")

</div>

Wow! This extension is sooooooooo cool! This might seem like an obvious question, but how would I use it in like a RPG game?

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 20, 2026, 8:40pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/7 "2026-07-20T20:40:25Z")

</div>

do you want a exzample and also do you mean code wise or whats the point of this because

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

take this for exzample

1.the create stat with name block for list fill the array with whatever you want say how fast they are threre image and there level fill the name of it with that ones name like Pikachu and make the list be like the category like pokemon

2.the get stats from stat with name from list block fill it wit the name of your stat/Pokemon and the list its in like Pokemon it will return the full list something like

Pokemon|Pikachu|fast|{}|13|

or the {} might be [object object] it gets weird with the images

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/1/91153c337d1a3cc6140daf16d89c6f6a983a687f.png)

this is

1.length of stat with name for list gives how many things are in the orange array part so most of I have it would give back 3

2.the length of list with name gives back the number of stats in the Pokemon array like so if I had 15 Pokemon with the Pokemon list it would say 15

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/d/5/d51c2ed9016c26415f728ea20903ad0072e83cf1.png)

this grabs the last stat that was random picked like if the random block gave back the Pikachu one and you set it to 0 it would be

Pokemon|Pikachu|fast|{}|13|

it would say Pokemon because the whole thing gets split up by the |

so in this case

0 = Pokemon

1 = Pikachu

2 = fast

3 = (the image)

4 = 13

5 = " "

or something like that 5 might be a blank because of the extra | but its fine

let me know if this helps a bit

---

<div class="post-metadata">

**Author:** ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)\
**Post date:** [July 21, 2026, 5:15am UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/8 "2026-07-21T05:15:40Z")

</div>

Yes, can I please get an example (maybe with all the blocks included?)! Also, does anything happen if you create a stat with **strength, image, and speed** , set it to a list (let’s say, **Enemy** ), and create another stat but with **strength, image, speed, and defense** and set it to that same list?

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 21, 2026, 3:50pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/9 "2026-07-21T15:50:25Z")

</div>

uhh i think the way the code works i think it might be fine

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 21, 2026, 6:39pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/10 "2026-07-21T18:39:57Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/9/c90584213e8ff985c093372e9ca503803346ec3e.png)

Update Log:

July 21 2026:

added

1.Amount of stats created it will return the number of stats made to kinda check have a made enough enemy’s and players or whatever

2.Every single stat it will return every single stat in this exzample it would return 1,2,3,4 kinda for saving or debuging or loading

Note though both of these blocks were made because I wanted something to do so if you guys think they are dumb or not needed or you like them let me know

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 25, 2026, 7:34pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/11 "2026-07-25T19:34:53Z")

</div>

anything you @CodaKnight want to see

---

<div class="post-metadata">

**Author:** ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)\
**Post date:** [July 26, 2026, 7:06pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/12 "2026-07-26T19:06:40Z")

</div>

I think it already covers the basics pretty well! The only things I can think of that would make it even more useful are:

- A **delete/remove stat** block.
- Another **delete/remove stat** block **for removing arrays.**
- A **clear all stats** block that clears all stats from all arrays or a single array.
- A **check if a stat exists** block that returns true/false.
- A **check if a list exists** block that returns true/false.
- Maybe a **rename list** or **rename stat** block without having to recreate it or having to change other stats.
- A block to **get all stat names** from a list.
- A **get stat count in list** block (pretty much my **length\_of\_stats** block just with a more descriptive name).
- An **add value to stat** block. (Ex: add 100 to stat “Player1”)
- A **set value at index** block. (Ex: set index “2” of stat “Player1” to 50)
- A **remove value at index** block. (Ex: remove index “3” from stat “Player1”)
- An **insert value at index** block. (Ex: insert “25” at index 1 of stat “Player1”)
- A **find stat by value** block. (Ex: find stat in list “Players” containing 100)
- An **index of stat** block. (Ex: index of stat “Player1” in list “Players”)
- A **remove random stat from list** block.
- A **shuffle list** block.

## Advanced Blocks

- A **copy stat to list** block. (Ex: copy stat “Player1” to list “Backup”)
- A **move stat from list to list** block (Ex: move stat “Sword” from “Inventory” to “Chest”)
- A **duplicate stat** block. (Ex: duplicate stat “Player1” as “Player2”)

Also, I had an implementation idea. In one of my extensions, I ended up using a helper function to find and parse the data once, and then all the other functions reused it. It helped remove a lot of duplicated code and made it easier to maintain. It might be a neat approach here too if you’re interested.

For example, you can do something like:

```typescript
/**
 * get the stat
*/
//% blockId=findStat
//% block="$name"
//% blockHidden=true shim=TD_ID
//% name.fieldEditor="autocomplete"
//% name.fieldOptions.decompileLiterals=true
//% name.fieldOptions.key="statName"
//% blockHidden=true
export function findStat(list: string, name: string): any[] {
    for (let i = 0; i < StatsArray.length; i++) {
        let row = StatsArray[i]
        let parts = (row[0] as string).split("|")

        if (parts[0] == list && parts[1] == name) {
            return row
        }
    }
    return undefined
}

```

Then the other blocks can just reuse it instead of looping through `StatsArray` every time. For example:

```typescript
//...other annotations for block here
export function length_of_stats(name: string, list: string): number {
    const row = findStat(list, name)
    if (!row) return 0

    const parts = (row[0] as string).split("|")
    return parts.length - 3
}

```

Then `get`, `change`, `length`, etc. could all just call `findStat(...)` instead of each looping through

Other than that, I think it’s in a really good place. Nice work! If you need help on understanding further, just ask me.

_Side Note:_ In your **Every single Stat in " " list** , you spelled list wrong: **lsit**.

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 26, 2026, 9:16pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/13 "2026-07-26T21:16:29Z")

</div>

ok then

Update Log:

July 26 2026:

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

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/c/5/c54af010f778a0d048931188e2d5239c4e4b1960.png)

ok done added some of the easy-ish ones

they should all work but the two remove and rename I was not sure 100% about but they seem to work so… yeah

---

<div class="post-metadata">

**Author:** ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)\
**Post date:** [July 27, 2026, 3:59am UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/14 "2026-07-27T03:59:41Z")

</div>

Alright thanks. Also, you don’t have to (because I know I gave you a lot of blocks), but are you going to add any other blocks from the ideas I gave you?

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 28, 2026, 2:04am UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/15 "2026-07-28T02:04:25Z")

</div>

maybe depends do you want ot need any more

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 28, 2026, 2:04am UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/16 "2026-07-28T02:04:45Z")

</div>

also @CodaKnight because you like this so much I was wondering do thing any of these blocks are dumb just cause I made some of these and could not think of any use for some of these

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 28, 2026, 2:04am UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/17 "2026-07-28T02:04:54Z")

</div>

Update Log:

July 27 2026:

I changed the get every stat name from list to

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

get every stat from list X at index X so you can grab every of X in the list instead of only grabbing the name

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/8/5/85b41f8fbd91156b5fe099ce7252aa87ef3d41c9.png)

I also removed the other blocks from here and put them in

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/1/5/159718a9dd55c9775998a7fb39a6da6ab7fa7093.png)

and also put the rename blocks into

 ![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/8/9898abb23c8ac84435df44eafa014e0d428acc2f.png)

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 28, 2026, 2:20am UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/18 "2026-07-28T02:20:05Z")

</div>

Update Log:

July 27 2026:

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/9/1/91078400c69b051576fbd4bdb268c73568df0b25.png)

added a check if list contains stat block

---

<div class="post-metadata">

**Author:** ![NeverStopTheCoder](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/neverstopthecoder/32/21194_2.png) [@NeverStopTheCoder](https://forum.makecode.com/u/NeverStopTheCoder)\
**Post date:** [July 28, 2026, 9:02pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/19 "2026-07-28T21:02:21Z")

</div>

Update Log:

July 28 2026:

![image](https://us1.discourse-cdn.com/flex020/uploads/makecode/original/3X/f/0/f048967625d904c2189bca1ad8b796532804305f.png)

added this find stat block it grabs the first time whatever you put inside the 2 input appears its not perfect but It does kinda work

---

<div class="post-metadata">

**Author:** ![CodaKnight](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.makecode.com/codaknight/32/33491_2.png) [@CodaKnight](https://forum.makecode.com/u/CodaKnight)\
**Post date:** [July 28, 2026, 9:04pm UTC](https://forum.makecode.com/t/extension-array-stats-extension/44888/20 "2026-07-28T21:04:02Z")

</div>

You honestly don’t have to add all of them, but I think that all those blocks would be helpful.

(Obviously some blocks more helpful than others.)

[Next page](https://forum.makecode.com/t/extension-array-stats-extension/44888.md?page=2)
