PaperMC / PaperMC/Paper

Handle end portal creation with PortalCreateEvent

Open
#13,832 1 comment 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?

Currently the PortalCreateEvent does not handle the end portal creation, and therefore does not allow to prevents its creation by cancelling the event, or execute custom behavior depending on the entity or blocks involved.

Describe the solution you'd like.

PortalCreateEvent should handle the end portal creation on the overworld.
Probably it should also handle other portal-like creations like:

  1. Creation of an end gateway
  2. Creation of the portal on the end fountain
Describe alternatives you've considered.

I have currently created this branch with a possible implementation:
https://github.com/PaperMC/Paper/compare/main...Biquaternions:Paper:feat/end-portal-creation-event

Patch on pastes.dev in case I update the branch and the diff mutates:
https://pastes.dev/gc3AVzYTde

This implementation has the following behavior:

  1. The player consumes the eye of ender when placing it on a frame
  2. The frame updates to hold the eye
  3. The PortalCreateEvent event gets fired

Observations:

  1. If the PortalCreateEvent is cancelled, the player will have consumed the eye of ender, and the portal frame will be unusable in the future, given the frames are unbreakable and the eyes cannot be removed to cause a future update.
  2. The server still triggers the end portal creation event and sends the corresponding packet (ClientboundLevelEventPacket).
  3. It does not account for the portal creation during world generation.
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

Start by reviewing the linked implementation branch and the PortalCreateEvent behavior described in the issue, including the three listed portal scenarios. Verify the cancellation and client/event behavior, item and frame state, and world-generation scope; done means the agreed end-portal handling addresses the caveats identified in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.