Conversation
sovdeeth
left a comment
There was a problem hiding this comment.
Looks good overall, just some cleanup
Thanks for the contribution!
|
|
||
| @Name("Entity Fuse Ticks") | ||
| @Description("Get/Set how long until a Creeper/Primed TNT explodes. For Creepers the fuse time will be 0 seconds and if set it will be ticking down even if the entity is not currently in exploding animation.") | ||
| @Example("send \"Run! That guy is going to explode in %fuse ticks of player's target%\"") |
There was a problem hiding this comment.
not a valid example according to the syntax pattern
| creeper.setFuseTicks(creeper.getFuseTicks() + change); | ||
| } else if (entity instanceof TNTPrimed tntprimed) { | ||
| tntprimed.setFuseTicks(tntprimed.getFuseTicks() + change); |
There was a problem hiding this comment.
Are there any concerns about setting to negative values or invalid values? if so, a clamp/min/max is needed.
| creeper.setMaxFuseTicks(change); | ||
| creeper.setFuseTicks(change); |
There was a problem hiding this comment.
Why are we setting the max here? I thought the max couldn't be changed?
There was a problem hiding this comment.
it appears it can be changed https://jd.papermc.io/paper/1.21.11/org/bukkit/entity/Creeper.html#setMaxFuseTicks(int)
There was a problem hiding this comment.
it may not be needed but I think it is
There was a problem hiding this comment.
well right now every time i try to set the max, it will error. Then when i set the normal fuse time, it will change both normal and max? Shouldn't which one it sets be dependent on which syntax I used?
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Co-authored-by: sovdee <10354869+sovdeeth@users.noreply.github.com>
Problem
Currently Skript nore Skbee have any way to do this and its a decently useful thing
Solution
I have made a syntax for it allowing you to set/get the fuse ticks of a primed tnt/creeper/charged creeper
Also removed 'https://github.com/SkriptLang/Skript/blob/master/src/main/java/ch/njol/skript/expressions/ExprCreeperMaxFuseTicks.java'
(ExprCreeperMaxFuseTicks.java) as it doesn't work and isn't needed if this pr is merged
Testing Completed
Compiled jar with code it works flawlessly for a primed tnt/creeper/charged creeper no bugs that i've seen
for creepers the fuse tick duration will always be ticking down even if it isn't in an 'exploding' state but that just looks like mc behavior so
Supporting Information
Deleted ExprCreeperMaxFuseTicks.java
Completes: none
Related: none
AI assistance: Used a tad bit of Claude though 95% of it is done by me