Skip to content

Conversation

NotSoDelayed
Copy link
Contributor

@NotSoDelayed NotSoDelayed commented Sep 19, 2025

Problem

Skript does not have a way to manipulate event locations for teleport related events.

Solution

This PR adds support for modifying said event values.

Additionally, I have unified PlayerPortalEvent and EntityPortalEvent into a single event class which also allows for a unified Skript documentation, as the core event logic of these events are exactly the same.

Testing Completed

My main objective prior to discovering the absence of these changers is to intercept portal usage to divert entities to another location. Specifically, I have a separate world that is for SMP, while also using the default nether world (world_nether). When you are returning from the nether, Minecraft will always send you to the main world instead of the origin world of the player previously came from.

The following code was used for testing:

on portal:
	teleport cause is nether portal
	player's world = world("world_nether")
	set {_dest_before} to past event-location  # verbosity
	set {_dest} to past event-location
	set x-pos of {_dest} to (x-pos of {_past}) * 8
	set z-pos of {_dest} to (z-pos of {_past}) * 8
	set world of {_dest} to world("smp")
	set event-location to {_dest}
	broadcast "Dest before: &c%{_dest_before}%"  # verbosity
	broadcast "Dest after : &a%event-location%"  # verbosity

Results before the change:
skript-evtportal

Results after the change:

skript-portal-poc.mp4

Supporting Information


Completes: none
Related: #5624

@NotSoDelayed NotSoDelayed requested a review from a team as a code owner September 19, 2025 10:12
@NotSoDelayed NotSoDelayed requested review from Pesekjak and erenkarakal and removed request for a team September 19, 2025 10:12
@skriptlang-automation skriptlang-automation bot added the needs reviews A PR that needs additional reviews label Sep 19, 2025
Copy link
Contributor

@Absolutionism Absolutionism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these should be moved to EvtMoveOn

@Absolutionism Absolutionism added the enhancement Feature request, an issue about something that could be improved, or a PR improving something. label Sep 19, 2025
@skriptlang-automation skriptlang-automation bot removed the needs reviews A PR that needs additional reviews label Sep 19, 2025
@sovdeeth sovdeeth linked an issue Sep 19, 2025 that may be closed by this pull request
1 task
@sovdeeth sovdeeth moved this to In Review in 2.13 Releases Sep 19, 2025
@NotSoDelayed NotSoDelayed changed the title Setters for Event Locations in Portal (and move) Events Setters for Event Locations in Teleport Events Sep 21, 2025
@github-project-automation github-project-automation bot moved this from In Review to Awaiting Merge in 2.13 Releases Sep 23, 2025
@Absolutionism Absolutionism merged commit d7595a6 into SkriptLang:dev/feature Sep 23, 2025
5 checks passed
@github-project-automation github-project-automation bot moved this from Awaiting Merge to Done - Awaiting Release in 2.13 Releases Sep 23, 2025
@Absolutionism Absolutionism added completed The issue has been fully resolved and the change will be in the next Skript update. and removed enhancement Feature request, an issue about something that could be improved, or a PR improving something. labels Sep 23, 2025
@NotSoDelayed NotSoDelayed deleted the feature/player-portal-location-changer branch September 24, 2025 09:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
completed The issue has been fully resolved and the change will be in the next Skript update.
Projects
Status: Done - Awaiting Release
Development

Successfully merging this pull request may close these issues.

Portal Events - Combining Similar Events
4 participants