Skip to content

BlockData Support - #8836

Open
Absolutionism wants to merge 3 commits into
SkriptLang:dev/featurefrom
Absolutionism:dev/BlockDataSupport
Open

BlockData Support#8836
Absolutionism wants to merge 3 commits into
SkriptLang:dev/featurefrom
Absolutionism:dev/BlockDataSupport

Conversation

@Absolutionism

Copy link
Copy Markdown
Contributor

Problem

Skript currently does not support retrieving, changing, and resetting blockdata tags of blocks

Solution

  • ExprBlockDataTags:

    • Gets all tags of a block or block related object
    • Reset all tags to default
  • ExprBlockDataValues:

    • Gets the tag values of a block or block related object
    • Set or Reset the tag values
    • Extensive error handling and informative error output
  • ExprBlockData (Updated):

    • Gets BlockData of block related objects
    • Reset BlockData to default
  • BlockDataHolder:

    • All current types that support retrieving BlockData from and changing
  • BlockDataValueType:

    • All typed values that support retrieving as and being changed to

Testing Completed

quickTest, manual testing

Supporting Information

N/A


Completes: none
Related: none
AI assistance: none

@Absolutionism
Absolutionism requested a review from a team as a code owner August 13, 2026 17:45
@Absolutionism
Absolutionism requested review from Efnilite and cheeezburga and removed request for a team August 13, 2026 17:45

@AnOwlBe AnOwlBe left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from a quick glance (mostly just my thoughts)

nothing major though

}

@Override
public BlockData getBlockData(ItemType itemType) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this a safe cast 100% of the time? I didn't really look into it too much though

Comment thread src/main/java/ch/njol/skript/classes/data/BukkitClasses.java
CondBlockDataTag::new,
types + " (has|have) [the] block[ ]data [tag[s]] %strings%",
types + " (is|are) tagged with [the] block[ ]data [tag[s]] %strings%",
types + "(is|are) tagged with %strings% block[ ]data",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this pattern in specific is confusing to me
would it not be better to say if {b} has "axis" block data? I think you are over-emphasizing "tags" in these patterns

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was just adding more options, as Mug had preferred the "is tagged" and Pickle said both would be fine.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants