Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

EntitySpawnEvent with optional source ItemStack #4795

Closed
Prof-Bloodstone opened this issue Nov 22, 2020 · 2 comments · May be fixed by #7377
Closed

EntitySpawnEvent with optional source ItemStack #4795

Prof-Bloodstone opened this issue Nov 22, 2020 · 2 comments · May be fixed by #7377
Labels
help wanted Community assistance requested, PRs welcome. status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: feature Request for a new Feature.

Comments

@Prof-Bloodstone
Copy link
Contributor

Is your feature request related to a problem? Please describe.
I'd love to be able to modify the entity when it gets spawned from some ItemStack (spawn egg, boat, item frame, ...) and act on that.

Describe the solution you'd like
Ability to retrieve to retrieve source ItemStack which caused the Entity to spawn.
I think it'd make most sense to add it as nulllable value to existing EntitySpawnEvent, since other events like CreatureSpawnEvent and ProjectileLaunchEvent might potentially also use this.

Describe alternatives you've considered
Patching the server source code directly :/

@Chew Chew added type: feature Request for a new Feature. and removed status: needs triage labels Nov 23, 2020
@Proximyst
Copy link
Contributor

I've looked into this before, and it's a tedious process to say the least. PRs welcome, but not a beginner issue :p

@Proximyst Proximyst added help wanted Community assistance requested, PRs welcome. status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. labels Nov 24, 2020
@Machine-Maker
Copy link
Member

Machine-Maker commented May 29, 2021

There's no overriden method for example to create an entity from an item, so this would probably have to be done for each item that does this which requires a list of items that do it

  • Spawn Eggs
  • Boats
  • Item Frame (HangingPlaceEvent)
  • Painting (HangingPlaceEvent)
  • Leash (HangingPlaceEvent)
  • Armor Stand
  • End Crystals
  • Fish Buckets
  • Fireworks

and what am I missing?

@PaperMC PaperMC locked and limited conversation to collaborators Apr 28, 2024
@codebycam codebycam converted this issue into discussion #10498 Apr 28, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
help wanted Community assistance requested, PRs welcome. status: accepted Disputed bug is accepted as valid or Feature accepted as desired to be added. type: feature Request for a new Feature.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants