-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f54c095
commit cbd63cf
Showing
1 changed file
with
20 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
type: text | ||
|
||
--- | ||
|
||
When trying to create a block with block state properties you might come across an error like this: | ||
`java.lang.IllegalArgumentException: Cannot set property ... as it does not exist in Block{minecraft:air}` | ||
|
||
This happens when you don't (correctly) override the `appendProperties` method in your block class. Overriding this method is necessary to tell minecraft which properties your block has. | ||
It should look something like this: | ||
```java | ||
@Override | ||
protected void appendProperties(StateManager.Builder<Block, BlockState> builder) { | ||
builder.add(YOUR, PROPERTIES, HERE); | ||
} | ||
``` | ||
|
||
On older versions (before 1.20.5) the method has to be `public` instead of `protected`. | ||
|
||
The error refers to your block as `minecraft:air` because it usually hasn't been registered by the time the error is thrown. | ||
You can usually find which block is having issues by looking for the constructor of it in the stacktrace. |