[SPIGOT-6020] Dispensers should trigger an event similar to BlockFertilizeEvent Created: 22/Jul/20  Updated: 19/Jun/21  Resolved: 12/May/21

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Minor
Reporter: Maartin Assignee: Unassigned
Resolution: Fixed Votes: 4
Labels: BoneMeal, Dispenser, Fertilize

Version: CraftBukkit version git-Spigot-0509002-7c03d25 (MC: 1.16.1) (Implementing API version 1.16.1-R0.1-SNAPSHOT)
Guidelines Read: Yes

 Description   

Dispensers should trigger an event similar to BlockFertilizeEvent, but with the block which performed the action (the dispenser) instead of a player.

Dispensers can use bone meal on grass blocks as well as nylium and generate plants such as grass, flowers, fungus, roots etc. It's the same behaviour as if a player would do it. We can easily check all the affected blocks when players use bone meal by listening for a BlockFertilizeEvent, though there's no relevant event triggered when a dispenser fertilizes a block.



 Comments   
Comment by Maartin [ 19/Jun/21 ]

I see now that I might've been a bit unclear when I made this issue, so I'll try to rephrase what I initially meant.

I thought it'd be nice if we somehow could access the source of a BlockFertilizeEvent, even if the source is a dispenser and not a player. The issue has been labeled as fixed, though the initial suggestion has not been "fixed" as far as I can tell (correct me if I'm wrong though). Should I create a new issue or is there a way to reopen this one?

Comment by Julian v.d Berkmortel [ 11/May/21 ]

Whilst working on this "issue" I realized that this also happens when a player uses bonemeal on a sapling. When a bonemeal is used on a sapling there is a chance that a tree will grow. If a tree doesn't grow because this chance of "fertilization" then the `BlockFertilizeEvent` is not called and thus bonemeal is subtracted.

Comment by Julian v.d Berkmortel [ 11/May/21 ]

Currently looking into the issue @Skizzles mentioned. I was able to reproduce it and working on a solution.

Comment by Skizzles [ 10/May/21 ]

Even with PR accepted and merged it still seems to take bonemeal even when the event gets canceled.

Comment by TheCreeperCow [ 29/Apr/21 ]

PR Submitted under #826

Comment by TheCreeperCow [ 21/Apr/21 ]

Ill start work on this

Generated at Tue Apr 15 09:41:53 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.