PaperMC / PaperMC/Paper

Player#getTargetEntity returns null for 1.21.10 mannequin

Open
#13,373 4 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

status: needs triage version: 1.21.10
Dominant language
Java
Stars
12.7k
Forks
3.5k
Avg merge
3d 13h
Merged PRs (30d)
11

Description

Expected behavior
var result = player.getTargetEntity(100, true);
// Result is null when aiming at mannequin entity
Observed/Actual behavior

It just returns null

Steps/models to reproduce

spawn a mannequin with code (/summon seems to work)

Plugin and Datapack List
Paper version

This server is running Paper version 1.21.10-115-main@af06383 (2025-11-21T23:42:01Z) (Implementing API version 1.21.10-R0.1-SNAPSHOT)
You are 2 version(s) behind
Download the new version at: https://papermc.io/downloads/paper

Edit: the 2 version updates available did not fix the issue

Other

for some reason, the /summon seems to work but spawned with code does not show, even tho in F3 it says that there is the entity.

Image

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

Use player.getTargetEntity(100, true) as the entry point and reproduce the issue with a mannequin summoned by command and one spawned with code on Paper 1.21.10-115-main. Done means the call returns the mannequin instead of null for the code-spawned entity.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.