microsoft / microsoft/minecraft-scripting-samples

Error regarding class structure

Open
#209 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
241
Forks
48
Avg merge
17m
Merged PRs (30d)
1

Description

There is a problem in scripting:

The code is:

class className{
constructor(){};
static{
variableName = 0;
}
}

And it gave me this error:

16:59:47[Scripting][error]-Plugin [Sample Add-on Pack - 1.0.0] - [main.js] ran with error: [SyntaxError: invalid property name at main.js:59]

What could be the problem?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The report points to main.js:59 and includes the class declaration that triggers the syntax error. Start by reproducing the error with that snippet and checking the scripting runtime's supported class and static-block syntax; done would require a confirmed cause and a clearly documented compatible form, but no specific code change is identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
game-dev
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.