PaperMC / PaperMC/Paper

Ability to cancel entities looking at other entities

Open
#12,625 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

Is your feature request related to a problem?

When creating systems such as vanish or minigames where you want to hide spectators from other players, you are as it is right now faced with the issue that entities that look at players still will look at players that are vanished or spectating.
Right now there are only methods to make entities look at other entities, not an event or such that lets you cancel the act.

Describe the solution you'd like.

Essentially I want a way to toggle or cancel what entities look at what players (or other entities). This could for example be done through an event:

It would be a "EntityLookAtEntityEvent" or something along those lines, that lets you access the entity that tries to look, and the entity that it tries to look at, and then have it be cancellable.

Describe alternatives you've considered.

I've considered putting the players in spectator-mode, causing the entities to not look at players, but it would be very neat if something like this could be implemented.

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

The issue names no files, tests, or entry points. First review the existing entity look-at API and event patterns, then determine the appropriate cancellable event contract for the looking and target entities; done means the behavior can be prevented selectively without relying on spectator mode.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.