Skip to content

Should the custom state strings need "as keyof BlockStateSuperset" adding #84

@MeerkatMC

Description

@MeerkatMC

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):

if (e.block.permutation.getState("mike_luck:unlucky") === true && Math.random() < 0.5) {

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) {

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions