microsoft / microsoft/minecraft-samples
Should the custom state strings need "as keyof BlockStateSuperset" adding
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 434
- Forks
- 246
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 1
Description
I tried buidling a few of these examples (whilst debugging my own script failure to build with custom state strings) as i switched from raw Javascript coding to using typescript.
I found that they failed (same as my own code):
I found help online and added "as keyof BlockStateSuperset" to the "getState" calls.
Should the examples be updated like this also?
ie.
if (e.block.permutation.getState("mike_luck:unlucky" as keyof BlockStateSuperset ) === true && Math.random() < 0.5) {
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with lucky_block/version_1/scripts/LuckyblockActions.ts at line 16 and inspect the getState call using the custom state string. Build the affected examples to confirm whether the TypeScript error is reproducible, then update the relevant example calls if required and verify that those examples build successfully.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- game-dev
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100