Skip to content

Conversation

CJH3139
Copy link
Contributor

@CJH3139 CJH3139 commented Oct 9, 2025

Problem

#7819

Solution

  • Added a bonemeal alias to Block Fertilize event as it was a little bit confusing to some ([block] fertilize -> "[block] (fertilize|bone[ ]meal)")
  • Added paper's EntityFertilizeEgg event that accepts mother and father entity from the breeding family expr
    • Errors when using event-entity as it's ambiguous
    • Errors when using child from ExprBreedingFamily (Still in blockstate or not an entity at all in some case)

Testing Completed

Tested both with a script and manually
image

    broadcast "Mother is: %breeding mother%"
    broadcast "Father is: %breeding father%"
image

Supporting Information


Completes: #7819
Related: none

Also change for:
  - block fertilize event bone[ ]meal alias
  - ExprBreedingFamily tweaks so that it also accepts the FertilizeEgg event
@CJH3139 CJH3139 requested a review from a team as a code owner October 9, 2025 08:10
@CJH3139 CJH3139 requested review from Burbulinis and erenkarakal and removed request for a team October 9, 2025 08:10
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Oct 9, 2025
@CJH3139
Copy link
Contributor Author

CJH3139 commented Oct 9, 2025

oh and on the error message screenshot, changed the first error message line to The 'bred child' expression cannot be used in a 'fertilize egg' event.

"\tif event-entity is a frog:",
"\t\tsend \"A frog just became pregnant!\""
)
.since("2.14");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
.since("2.14");
.since("INSERT VERSION");

.since("2.14");

EventValues.registerEventValue(EntityFertilizeEggEvent.class, Entity.class, event -> {
assert false;
Copy link
Member

Choose a reason for hiding this comment

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

this will error on all servers with the ea flag, so probably best to remove it

Comment on lines +42 to +45
if (!getParser().isCurrentEvent(EntityBreedEvent.class) && !getParser().isCurrentEvent(EntityFertilizeEggEvent.class)) {
Skript.error("The 'breeding family' expression can only be used in an breed or fertilize egg event.");
return false;
}
Copy link
Member

Choose a reason for hiding this comment

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

EventRestrictedSyntax

Copy link
Member

Choose a reason for hiding this comment

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

where's the java code for summoning the frogs?

Comment on lines 14 to 15
public class EvtFertilizeEgg extends SkriptEvent {
static {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public class EvtFertilizeEgg extends SkriptEvent {
static {
public class EvtFertilizeEgg extends SkriptEvent {
static {

Comment on lines 21 to 27
.examples(
"on fertilizing egg of turtles:",
"\tsend \"A turtle just fertilized an egg!\"",
"on fertilizing egg:",
"\tif event-entity is a frog:",
"\t\tsend \"A frog just became pregnant!\""
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
.examples(
"on fertilizing egg of turtles:",
"\tsend \"A turtle just fertilized an egg!\"",
"on fertilizing egg:",
"\tif event-entity is a frog:",
"\t\tsend \"A frog just became pregnant!\""
)
.examples("""
on fertilizing egg of turtles:
send "A turtle just fertilized an egg!"
on fertilizing egg:
if event-entity is a frog:
send "A frog just became pregnant!"
""")

Also, use broadcast instead of send since that's invalid as there's no default player to send a message to.


@Override
public String toString(@Nullable Event event, boolean debug) {
return "on fertilizing egg" + (entitiesLiteral == null ? "" : " of " + entitiesLiteral);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return "on fertilizing egg" + (entitiesLiteral == null ? "" : " of " + entitiesLiteral);
return "on fertilizing egg" + (entitiesLiteral == null ? "" : " of " + entitiesLiteral.toString(event, debug));

@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Oct 10, 2025
@sovdeeth sovdeeth added enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature Pull request adding a new feature. labels Oct 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Feature request, an issue about something that could be improved, or a PR improving something. feature Pull request adding a new feature.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants