PaperMC / PaperMC/Paper

EntityRemoveFromWorldEvent EnderPearl has no owner when going through a Nether Portal

Open
#8,397 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

status: input wanted type: bug version: 1.19
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior

When shooting an Ender Pearl through a Nether Portal and it fires the EntityRemoveFromWorldEvent I would assume the EnderPearl to still have an owner as it would when the Ender Pearl gets destroyed by the void. Ender Pearls that get destroyed by the void do have their shooter still associated to them

Observed/Actual behavior

The owner property of the Ender Pearl entity is null

Steps/models to reproduce

The following snippet does some checks on the event, when you shoot an Ender Pearl into the void the console will print All good, but if you shoot it through a Nether Portal it will print Shooter is null.

    @EventHandler
    fun pearlDestroyed(event: EntityRemoveFromWorldEvent) {
        if (event.entity.type != EntityType.ENDER_PEARL) {
            logger.info("Not a pearl")
            return
        }

        val pearl = event.entity as EnderPearl
        if (pearl == null) {
            logger.info("Pearl is null")
            return
        }

        logger.info(pearl.entityId.toString())

        if (pearl.shooter == null) {
            logger.info("Shooter is null")
            return
        }

        val player = pearl.shooter as Player
        if (player == null) {
            logger.info("Shooter is not a player")
            return
        }

        logger.info("All good")
    }
Plugin and Datapack List

Plugins: TestPlugin (my own) and VoxelSniper
Datapacks: None

Paper version
> version
[14:00:00 INFO]: Checking version, please wait...
[14:00:00 INFO]: This server is running Paper version git-Paper-176 (MC: 1.19.2) (Implementing API version 1.19.2-R0.1-SNAPSHOT) (Git: f7d16f6)
You are running the latest version
Previous version: git-Paper-175 (MC: 1.19.2)
Other

No response

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the issue with EntityRemoveFromWorldEvent, an EnderPearl, and a Nether Portal, comparing it with void removal where the shooter is retained. Trace the Nether Portal removal path and EnderPearl owner handling first. Done means the event exposes the pearl's shooter through a Nether Portal, with a regression test covering both removal cases.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.