Skip to content

Fix EffFeed#8702

Open
hotpoc wants to merge 7 commits into
SkriptLang:dev/patchfrom
hotpoc:master
Open

Fix EffFeed#8702
hotpoc wants to merge 7 commits into
SkriptLang:dev/patchfrom
hotpoc:master

Conversation

@hotpoc

@hotpoc hotpoc commented Jun 12, 2026

Copy link
Copy Markdown

Problem

The person who updated the now current feed effect forgot to add a max level, so it stacks every time you do the normal feed player. I think it should instead only go above the max if specified with by %-number%, as it makes more sense logically (at least in my head).

Solution

It fixes it by just setting the food level to 20 if the beef amount isn't set.

Testing Completed

I did:
!feed player
!send food level of me

!feed player by 40
!send food level of me

And it seemed to work fine

Supporting Information

I guess it's a breaking change if players are using it specifically to stack feed themselves? I don't see why anyone would, though.


Completes: none
Related: none
AI assistance: none

@hotpoc
hotpoc requested a review from a team as a code owner June 12, 2026 04:18
@hotpoc
hotpoc requested review from Efnilite and Pesekjak and removed request for a team June 12, 2026 04:18
@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 12, 2026
@skriptlang-automation

This comment has been minimized.

@AnOwlBe

AnOwlBe commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

wonder if this would be better as an expr eg set saturation of player to 5 add 5 to saturation of player

edit: nvm ignore me that already exists

@skriptlang-automation skriptlang-automation Bot added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Jun 12, 2026
@skriptlang-automation skriptlang-automation Bot moved this to In Review in 2.16 Releases Jun 12, 2026
@TheMug06

Copy link
Copy Markdown
Contributor

Please target dev/patch or dev/feature

@skriptlang-automation skriptlang-automation Bot removed the needs triage An issue that hasn't been classified or verified yet label Jun 12, 2026

@TheMug06 TheMug06 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.

lgtm apart from requested change and base branch

Comment thread src/main/java/ch/njol/skript/effects/EffFeed.java Outdated
@AnOwlBe

AnOwlBe commented Jun 12, 2026

Copy link
Copy Markdown
Contributor
image am I missing something or did you remove the registry just to replace it with the older deprecated registry-

@TheMug06

Copy link
Copy Markdown
Contributor

Oop i forgot about the new registry
Yeah please stick to the new registry!!!

Comment thread src/main/java/ch/njol/skript/effects/EffFeed.java Outdated
@hotpoc

hotpoc commented Jun 13, 2026

Copy link
Copy Markdown
Author

am I missing something or did you remove the registry just to replace it with the older deprecated registry-

i was gonna use the newer one but all the files i checked that used it all had their own module things to register them with. i didn't really know where to put it. where should it go?

@AnOwlBe

AnOwlBe commented Jun 13, 2026

Copy link
Copy Markdown
Contributor

in playermodule as its relating to feeding a player

@hotpoc
hotpoc changed the base branch from master to dev/patch June 13, 2026 00:56
@hotpoc
hotpoc requested a review from TheMug06 June 13, 2026 01:18
Comment thread src/main/java/ch/njol/skript/effects/EffFeed.java
@hotpoc
hotpoc requested a review from TheMug06 June 16, 2026 00:28
Comment thread src/main/java/ch/njol/skript/effects/EffFeed.java Outdated
Comment thread src/main/java/ch/njol/skript/effects/EffFeed.java Outdated
Comment thread src/main/java/ch/njol/skript/effects/EffFeed.java Outdated
@hotpoc
hotpoc requested a review from Absolutionism June 19, 2026 22:19
@skriptlang-automation skriptlang-automation Bot removed the needs reviews A PR that needs additional reviews label Jun 22, 2026
Comment thread src/main/java/ch/njol/skript/effects/EffFeed.java Outdated
@skriptlang-automation skriptlang-automation Bot added the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Jun 27, 2026
return "feed " + players.toString(event, debug) + (beefs != null ? " by " + beefs.toString(event, debug) : "");
}


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.

Suggested change

extraneous space

@@ -20,41 +21,41 @@
@Since("2.2-dev34")
public class EffFeed extends Effect {

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 class should also be moved to the PlayerModule directory. specifically org/skriptlang/skript/bukkit/entity/player/elements/effects

Comment on lines +46 to +48
Number n = beefs.getSingle(event);
if (n != null)
foodAmount = n.intValue();

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.

I would retain the behavior of terminating if n is null.

@skriptlang-automation skriptlang-automation Bot removed the patch-ready A PR/issue that has been approved and is ready to be merged/closed for the next patch version. label Jun 30, 2026

@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.

I forgot to click 'submit review' on these 2 weeks ago but should still apply by now

@@ -1,17 +1,18 @@
package ch.njol.skript.effects;

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.

should be in org/skriptlang/skript/bukkit/entity/player/elements/effects

private Expression<Number> beefs;

@Override
public boolean init(Expression<?>[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) {

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.

Should use ParseResult not SkriptParser.ParseResult


@Override
public String toString(@Nullable Event e, boolean debug) {
return "feed " + players.toString(e, debug) + (beefs != null ? " by " + beefs.toString(e, debug) : "");

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.

could use SyntaxStringBuilder

@SuppressWarnings("null")
private Expression<Player> players;
@Nullable
private Expression<Number> beefs;

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.

Just my thoughts but why is this named beefs? couldn't it be named something like amount

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i dont know bro

register(addon,
EffBan::register,
EffKick::register,
EffFeed::register,

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.

Should be before EffKick I believe

}
public static void register(SyntaxRegistry registry) {
registry.register(SyntaxRegistry.EFFECT, SyntaxInfo.builder(EffFeed.class)
.addPatterns("feed %players% [by %-number% [beef[s]]]")

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.

I believe someone already asked this in another pr or at some point but why is there beef in the syntax it just seems off

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

i dont know bro its optional though

@AnOwlBe AnOwlBe Jun 30, 2026

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.

well atleast imo it should be removed as its kind of misleading as if you eat beef/steak ingame it feeds by 6 health so if you do feed player by 1 beef kind of misleading

though for this pr probably not best idea as it'd cause breaking changes

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.

Beefs, as that's what the hunger bars could be refered to, don't see the use in removing it, would just cause it to break for anyone using it.

@github-project-automation github-project-automation Bot moved this to In Review in 2.17 Releases Jul 1, 2026
@github-project-automation github-project-automation Bot moved this to In Review in 2.16 Releases Jul 1, 2026
@APickledWalrus APickledWalrus added the bug An issue that needs to be fixed. Alternatively, a PR fixing an issue. label Jul 1, 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. enhancement Feature request, an issue about something that could be improved, or a PR improving something.

Projects

Status: In Review

Development

Successfully merging this pull request may close these issues.

6 participants