Skip to content

Add entity cap check of armor stands & end crystals into player interact listener #4654

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

FlorianMichael
Copy link

Overview

When cancelled in the creature spawn event and placed by a player, the player will lose the armor stand / end crystal item from their inventory. This PR aims to fix this by moving the verification whether the entity should be cancelled up to the spawn egg right click, this way the item is not touched.

I tried my best to verify this is not breaking anything; I'm not sure if the original code in EntitySpawnListener should be kept? Reviews appreciated.

Submitter Checklist

  • Make sure you are opening from a topic branch (/feature/fix/docs/ branch (right side)) and not your main branch.
  • Ensure that the pull request title represents the desired changelog entry.
  • New public fields and methods are annotated with @since TODO.
  • I read and followed the contribution guidelines.

…er interact listener

When cancelled in the creature spawn event and placed by a player, the player will lose the armor stand / end crystal item from their inventory. This PR aims to fix this by moving the verification whether the entity should be cancelled up to the spawn egg right click, this way the item is not touched.

I tried my best to verify this is not breaking anything; I'm not sure if the original code in EntitySpawnListener should be kept? Reviews appreciated.

Signed-off-by: FlorianMichael <[email protected]>
@FlorianMichael FlorianMichael requested a review from a team as a code owner May 19, 2025 18:07
@github-actions github-actions bot added the Bugfix This PR fixes a bug label May 19, 2025
@SirYwell
Copy link
Member

I assume moving this check isn't okay. Spawning should also be prevented when caused by e.g. dispensers, throwing eggs, etc.

If the entity is not spawned by the player, this check is still needed

Signed-off-by: FlorianMichael <[email protected]>
@FlorianMichael FlorianMichael changed the title Move entity cap check of armor stands & end crystals into player interact listener Add entity cap check of armor stands & end crystals into player interact listener May 19, 2025
@FlorianMichael
Copy link
Author

@SirYwell Hm yeah, I forgot that. Added the original code back now, this way it's cancelled on interaction level when the player spawns the entity and otherwise on creature spawn level.

@dordsor21 dordsor21 requested a review from a team May 30, 2025 15:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bugfix This PR fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants