Skip to content

Add entity size expression#7702

Merged
erenkarakal merged 16 commits into
SkriptLang:dev/featurefrom
Fusezion:feature/entity-size
Mar 31, 2025
Merged

Add entity size expression#7702
erenkarakal merged 16 commits into
SkriptLang:dev/featurefrom
Fusezion:feature/entity-size

Conversation

@Fusezion
Copy link
Copy Markdown
Contributor

Description

This PR aims to add a new expression for changing and getting the sizes of slimes and phantoms, this is not the same as changing attribute scale, slimes when changed will have changes done to their attributes for health, attack damage, and movement speed.

I've decided to fully prevent infinity and NaN values due to poorly defined behavior. When setting a value to NaN before would cause the value to be reset compared to setting it to null will do nothing, as a means to retain parity this was decided upon.

Any feedback regarding the description or test is welcomed they all seem to run fine and the same goes for ingame. As for why I didn't use with "" or whatever it was is to keep messages readable if errors appear, this relies more on the expected but got error.


Target Minecraft Versions: any
Requirements: none
Related Issues: none

Copy link
Copy Markdown
Member

@Efnilite Efnilite left a comment

Choose a reason for hiding this comment

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

needs tests for adding/removing/setting infs and nans and for removing that it becomes below 0

Comment thread src/main/java/ch/njol/skript/expressions/ExprEntitySize.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprEntitySize.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprEntitySize.java Outdated
@Efnilite Efnilite added the feature Pull request adding a new feature. label Mar 15, 2025
Comment thread src/main/java/ch/njol/skript/expressions/ExprEntitySize.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprEntitySize.java
Co-authored-by: SirSmurfy2 <82696841+TheAbsolutionism@users.noreply.github.com>
Comment thread src/main/java/ch/njol/skript/expressions/ExprEntitySize.java Outdated
Comment thread src/main/java/ch/njol/skript/expressions/ExprEntitySize.java Outdated
@sovdeeth sovdeeth requested a review from a team as a code owner March 22, 2025 17:49
@sovdeeth sovdeeth requested review from UnderscoreTud and removed request for a team March 22, 2025 17:49
@Fusezion Fusezion requested a review from sovdeeth March 23, 2025 06:20
@sovdeeth sovdeeth added the feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version. label Mar 23, 2025
@erenkarakal erenkarakal merged commit d3acac0 into SkriptLang:dev/feature Mar 31, 2025
@Fusezion Fusezion deleted the feature/entity-size branch April 7, 2025 14:17
erenkarakal added a commit to erenkarakal/Skript that referenced this pull request Nov 26, 2025
* ExprEntitySize - Add entity size for slimes and phantoms

* ExprEntitySize - Add null and nan to test

* ExprEntitySize - Follow nbt format for slimes

* ExprEntitySize.java - description change

* Apply suggestions from code review

Handle documentation changes

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>

* ExprEntitySize.java - deltaSize

* ExprEntitySize.java - Fix integer overflow

* ExprEntitySize.sk - Expand test cases

* ExprEntitySize.java - deltaSize -> sizeDelta

* "I" Helped

Co-authored-by: SirSmurfy2 <82696841+TheAbsolutionism@users.noreply.github.com>

* Update src/main/java/ch/njol/skript/expressions/ExprEntitySize.java

Whoops

Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>

* ExprEntitySize.java - Update description to include default sizes

---------

Co-authored-by: Efnilite <35348263+Efnilite@users.noreply.github.com>
Co-authored-by: SirSmurfy2 <82696841+TheAbsolutionism@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: Eren <67760502+erenkarakal@users.noreply.github.com>
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. feature-ready A PR/issue that has been approved, tested and can be merged/closed in the next feature version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants