Skip to content

Changeable Conditions - #8707

Merged
APickledWalrus merged 15 commits into
dev/featurefrom
feature/changeable-conditions
Oct 1, 2026
Merged

APickledWalrus merged 15 commits into
dev/featurefrom
feature/changeable-conditions

Conversation

@APickledWalrus

Copy link
Copy Markdown
Member

Problem

For some time, we have been recommending a combination of Condition+Effect in favor of a boolean Expression. However, there is some loss of ease of use:

  • Losing support for EffToggle: toggle the player's gliding state
  • Losing support for one-line changing: set the player's gliding state to {_boolean}

If Conditions were to support changing, these features could be restored in some manner, preserving the ease of use options provided by boolean Expressions.

Solution

This PR proposes a simple API for changing the values represented by conditions. This API is further extended by PropertyCondition to make implementing even easier.

I decided to allow any changer to be used, though some modes are likely pointless. We could instead have specific methods for whether SET or RESET are allowed (as an example as those are probably the only realistic modes to support). I'd like opinions to tweak this.

This API is then used by ExprWhether to allow changing conditions:

  • toggle whether player is gliding
  • set whether the player is gliding to {_boolean}

There is a large number of files changed as I implemented this for most conditions where it made sense.

Testing Completed

Some in-game testing. I added at least 40 new tests covering many of the updated conditions.

Supporting Information

n/a


Completes: none
Related: none
AI assistance: none

@APickledWalrus
APickledWalrus requested review from a team as code owners June 16, 2026 21:22
@APickledWalrus
APickledWalrus requested review from UnderscoreTud and erenkarakal and removed request for a team June 16, 2026 21:22
@skriptlang-automation skriptlang-automation Bot added needs reviews A PR that needs additional reviews needs triage An issue that hasn't been classified or verified yet labels Jun 16, 2026
@skriptlang-automation

This comment has been minimized.

@skriptlang-automation skriptlang-automation Bot added feature Pull request adding a new feature. and removed needs triage An issue that hasn't been classified or verified yet labels Jun 16, 2026
@APickledWalrus
APickledWalrus requested a review from sovdeeth June 16, 2026 21:23
@skriptlang-automation skriptlang-automation Bot moved this to In Review in 2.16 Releases Jun 16, 2026
@ShaneBeee

This comment was marked as off-topic.

@sovdeeth sovdeeth left a comment

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.

looking good

Comment thread src/main/java/ch/njol/skript/conditions/base/PropertyCondition.java Outdated
Comment thread src/main/java/ch/njol/skript/conditions/base/PropertyCondition.java
Comment thread src/main/java/ch/njol/skript/conditions/CondIsEating.java Outdated
Comment thread src/main/java/ch/njol/skript/conditions/CondIsInvulnerable.java Outdated
Comment thread src/main/java/ch/njol/skript/conditions/CondIsLeftHanded.java Outdated
Comment thread src/main/java/ch/njol/skript/conditions/CondIsScreaming.java Outdated
Comment thread src/main/java/ch/njol/skript/conditions/CondPvP.java

@Efnilite Efnilite left a comment

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.

almost there 🙏

Comment thread src/main/java/ch/njol/skript/conditions/base/PropertyCondition.java Outdated
Comment thread src/main/java/ch/njol/skript/conditions/CondCanPickUpItems.java
Comment thread src/main/java/ch/njol/skript/conditions/CondIsCharged.java Outdated
Comment thread src/main/java/ch/njol/skript/conditions/CondIsDancing.java
Comment thread src/main/java/ch/njol/skript/conditions/CondIsSheared.java
Comment thread src/main/java/ch/njol/skript/conditions/CondPvP.java
Comment thread src/main/java/ch/njol/skript/conditions/CondIsFireResistant.java
@APickledWalrus
APickledWalrus merged commit 805fad1 into dev/feature Oct 1, 2026
12 checks passed
@APickledWalrus
APickledWalrus deleted the feature/changeable-conditions branch October 1, 2026 20:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature Pull request adding a new feature. needs reviews A PR that needs additional reviews

Projects

Status: Done - Awaiting Release

Development

Successfully merging this pull request may close these issues.

4 participants