replace item (1) of (list) with (thing) — Scratch Block Guide
Overwrites the existing value at a specific slot in the list.
What this block does
Overwrites the existing value at a specific slot in the list.
Update a tile on a grid map, change a clone’s stored x/y, or swap two elements during sorting.
- Category: Variables & Lists
- Key tip: Index must be between 1 and the current length of the list.
Working Scratch example
Try building this small script in the Scratch editor, predict what will happen, then click the green flag to test it.
- When green flag clicked
- Replace item 2 of grid with Wall
Try it: Changes slot #2 to "Wall" without altering the list length.
Related block guides
Explore other blocks in the same category or return to the full English Block Dictionary.
FAQ
When should I use "replace item (1) of (list) with (thing)" in Scratch?
Update a tile on a grid map, change a clone’s stored x/y, or swap two elements during sorting. Index must be between 1 and the current length of the list.
This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.