-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ItemSpawnEntityEvent and BlockPlaceEntityEvent and expand EntityPlaceEvent #7377
base: master
Are you sure you want to change the base?
Add ItemSpawnEntityEvent and BlockPlaceEntityEvent and expand EntityPlaceEvent #7377
Conversation
This is not the same as #4184? |
@molor a couple differences with that
|
This would probably also close #6898, at least in regards to what I initially wanted to achieve. |
ed8ab11
to
69d8686
Compare
Something I'm not sure about, are fire charges from dispeners? those technically do spawn an entity from an itemstack. but its different because a player can't do the same thing. |
I would say the event should be called in this case, as it otherwise would be inconsistent to call the events for something like fireworks and spawn eggs, but not for fire charges. And to me it would be more likely for someone wanting to modify the dispensed fire charge, then someone wondering why there's always a null player on an entity which cannot be "summoned" by a player. |
Ok, that makes sense, but should it be EntityPlaceEvent or ItemSpawnEntityEvent? I’m leaning to EntityPlaceEvent even tho it’s more of a launch. (Like fireworks I guess) |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. |
63e20ae
to
44f3765
Compare
I've decided against adding Fire Charges and fireworks. I don't want to add any projectiles. They already have api that tracks their spawning stack and shooter. I did add PrimedTNT to the list, since a dispenser is placing that and its creating an entity. |
patches/server/0918-Add-ItemSpawnEntityEvent-and-expand-EntityPlaceEvent.patch
Outdated
Show resolved
Hide resolved
44f3765
to
80ab89b
Compare
Rebased for 1.19 |
80ab89b
to
a64caa7
Compare
Rebased and updated for 1.19.3. Reworked things a big to keep EntityPlaceEvent a player-only event. |
b1092b2
to
dfb0e36
Compare
Rebased for 1.20.4 |
gave this a look over as much as I can with my level of sleep and sight, overall looks fine of what I've seen |
dfb0e36
to
5ef0ea1
Compare
Rebased for 1.20.6 |
Half a year has passed. Has this PR been forgotten? Up to now, there is still a lack of an event for tracking the generation of fish by using buckets. |
WIP so far, still adding spots these events should be called, but should be a catch-all now for non-hanging entities spawned as a result of item "placement".
Resolves #4795
Resolves #6898
Supersedes #4184
Changes
Adds ItemSpawnEntityEvent
Adds PlaceEntityEvent (extends ItemSpawnEntityEvent)
Adds BlockPlaceEntityEvent (extends PlaceEntityEvent)
Makes EntityPlaceEvent extend PlaceEntityEvent
Added an ItemStack field on ItemSpawnEntityEvent since that applies to all uses of that event and EntityPlaceEvent.
New Event Calls
ItemSpawnEntityEvent
EntityPlaceEvent (player only)
BlockPlaceEntityEvent (dispenser only)
Entity Placements