Skip to content

Fixes the BlockStateBlock init for a BlockState that isn't placed#8445

Open
TheLimeGlass wants to merge 1 commit intoSkriptLang:dev/patchfrom
TheLimeGlass:fix/blockstateblock-init
Open

Fixes the BlockStateBlock init for a BlockState that isn't placed#8445
TheLimeGlass wants to merge 1 commit intoSkriptLang:dev/patchfrom
TheLimeGlass:fix/blockstateblock-init

Conversation

@TheLimeGlass
Copy link
Contributor

Problem

[21:49:18 ERROR]: #!#! Caused by: java.lang.IllegalStateException: The blockState must be placed to call this method
[21:49:18 ERROR]: #!#!     at com.google.common.base.Preconditions.checkState(Preconditions.java:513)
[21:49:18 ERROR]: #!#!     at org.bukkit.craftbukkit.block.CraftBlockState.requirePlaced(CraftBlockState.java:349)
[21:49:18 ERROR]: #!#!     at org.bukkit.craftbukkit.block.CraftBlockState.getBlock(CraftBlockState.java:200)
[21:49:18 ERROR]: #!#!     at org.bukkit.craftbukkit.block.CraftBlockState.getBlock(CraftBlockState.java:26)
[21:49:18 ERROR]: #!#!     at Skript-2.14.1.jar//ch.njol.skript.util.BlockStateBlock.<init>(BlockStateBlock.java:56)

Solution

Make sure that BlockState#isPlaced is valid before running a raw initialization call. BlockStateBlock is designed to operate like a block without having the block actually placed. Having this in the init makes the class useless.

Testing Completed

It no error anymore

Supporting Information


Completes: none
Related: none
AI assistance: none

@TheLimeGlass TheLimeGlass requested a review from a team as a code owner February 16, 2026 03:24
@TheLimeGlass TheLimeGlass requested review from Burbulinis and sovdeeth and removed request for a team February 16, 2026 03:24
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Feb 16, 2026
@sovdeeth sovdeeth added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Feb 16, 2026
@skriptlang-automation skriptlang-automation bot added patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. and removed needs reviews A PR that needs additional reviews labels Feb 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants