Skip to content
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

Duplication issue with /give command and custom item entity in Item class #1833

Open
Tiviacz1337 opened this issue Jan 10, 2025 · 2 comments
Labels
triage Needs triaging and confirmation

Comments

@Tiviacz1337
Copy link

Minecraft Version: 1.21.1 (Probably more affected)

NeoForge Version: 21.1.93
Logs: No logs
Code:

Notes for easier reproduction:

  • hasCustomEntity(ItemStack stack) -> change return hasCustomData(stack) to return true

Steps to Reproduce:

  1. execute /give travelersbackpack:bat command
  2. 1 Copy of item lands in player inventory, second copy is created and is being thrown in world

Description of issue:
When a modded item implements the hasCustomEntity method and the createEntity method to create a custom entity when added to the world, it causes the entity to duplicate when the /give command is used

@Tiviacz1337 Tiviacz1337 added the triage Needs triaging and confirmation label Jan 10, 2025
@KnightMiner
Copy link
Contributor

This is a very old bug, see MinecraftForge/MinecraftForge#7785 and the issues it links. See also MinecraftForge/MinecraftForge#2349 which was reported fixed.

@Tiviacz1337
Copy link
Author

So workarounds are needed? The second issue has the solution proposed but it seems like it was never introduced. Then reported that bug does not occur in 1.13, but it happens now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
triage Needs triaging and confirmation
Projects
None yet
Development

No branches or pull requests

2 participants