Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/decentraland-scenes/wearables-scanner
A simple scene that shows how to fetch player wearable data to match against a criteria. In this case, only players wearing eyewear are allowed in.
https://github.com/decentraland-scenes/wearables-scanner
decentraland
Last synced: about 1 month ago
JSON representation
A simple scene that shows how to fetch player wearable data to match against a criteria. In this case, only players wearing eyewear are allowed in.
- Host: GitHub
- URL: https://github.com/decentraland-scenes/wearables-scanner
- Owner: decentraland-scenes
- License: apache-2.0
- Created: 2020-06-24T16:46:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-03-23T18:53:14.000Z (over 2 years ago)
- Last Synced: 2024-05-02T17:52:50.229Z (8 months ago)
- Topics: decentraland
- Language: TypeScript
- Homepage:
- Size: 8.93 MB
- Stars: 3
- Watchers: 3
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- Awesome-Repository - Wearables Scanner
README
# wearables-scanner
A simple scene that shows how to fetch player wearable data to match against a criteria. In this case, only players wearing eyewear are allowed in.
![](screenshot/scanner.gif)
This scene shows you:
- How to fetch the wearables currently worn by a player
- How to handle async functions
- How to delay an action with the utils library
- How to define the elements of a scene as game objects, with state and functionsHere we're querying the player's wearable items that are being equipped, and also fetching the full list of Decentraland wearables. We then match both these lists up to obtain more information about each of the wearables that the player has equipped, and check if any of these belongs to the 'eyewear' category.
Feel free to reuse the models and code from this scene!
## Try it out
**Install the CLI**
Download and install the Decentraland CLI by running the following command:
```bash
npm i -g decentraland
```**Previewing the scene**
Download this example and navigate to its directory, then run:
```
$: dcl start
```Any dependencies are installed and then the CLI opens the scene in a new browser tab.
```
&ENABLE_WEB3
```For example, if the URL is `http://127.0.0.1:8000?position=0%2C0&SCENE_DEBUG_PANEL`, make it `http://127.0.0.1:8000?position=0%2C0&SCENE_DEBUG_PANEL&ENABLE_WEB3`
Learn more about how to build your own scenes in our [documentation](https://docs.decentraland.org/) site.
If something doesn’t work, please [file an issue](https://github.com/decentraland-scenes/Awesome-Repository/issues/new).
## Copyright info
This scene is protected with a standard Apache 2 licence. See the terms and conditions in the [LICENSE](/LICENSE) file.