(list) contains (thing)? — Scratch Block Guide
Boolean block returning true if an exact item exists anywhere in the list.
What this block does
Boolean block returning true if an exact item exists anywhere in the list.
Check whether the player already picked up a key or visited a room.
- Category: Variables & Lists
- Key tip: Much cleaner than maintaining 15 separate "has_item_1" variables.
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
- If (bag) contains (Golden Key)? then
- Say Door unlocked!
Try it: Unlocks the door cleanly if Golden Key is in the inventory list.
Related block guides
Explore other blocks in the same category or return to the full English Block Dictionary.
FAQ
When should I use "(list) contains (thing)?" in Scratch?
Check whether the player already picked up a key or visited a room. Much cleaner than maintaining 15 separate "has_item_1" variables.
This guide is provided for educational purposes. Scratch screens and terms may change over time, so please check the official Scratch website as well.