Minecraftforge: [Request] Teleport Event

Created on 26 Nov 2017  路  11Comments  路  Source: MinecraftForge/MinecraftForge

Spigot and Sponge have a TeleportEvent, Forge unfortunately does not.
This is currently for us an issue as for whatever reason, players are teleported 1 block down, instead of where they're supposed to be teleported to (due to a mod in the modpack).

This could be easily fixed with a custom plugin, but without a Teleport Event, that's pretty much a no-go (Especially with the current lack of documentation about Forge).

It'd be great if this could be added to Forge.

Version: 1.12.2 - 14.23.1.2554

All 11 comments

There's an EnderTeleportEvent already. Mods should be making use of that.

@KingLemming EnderTeleportEvent isn't applicable to things such as /spawn or /home

A "teleport" is virtually indistinguishable from a raw setPosition call in vanilla/Forge, so this would be quite hard to do without getting every mod to fire it properly

Does Forge not utilize a Entity.teleport() method?

there is no Entity.teleport() method. All teleports are just setting the position.

Or should we add event when teleporters are used?

no, those are different, for interdimensional repositioning. I think OP wants a general "teleport" event like with /spawn, /home, waystones, RFTools teleporters, etc. which is hard to do in a general manner without bothering every single mod to fire it.

Honestly, to fix your problem an event which mods can call would be a bad solution. It is best to find what mod is causing the issue and remove it, or report to the author so they can fix it.

As it happens, I've noticed the same bug in the modpack I play - I'll see if I can divert some time to tracking the issue down.

As for your request as a whole, I'm not sure what the use case would be for a teleport event (or method) that other mods can call, aside from your stated use case which is just working round an issue. Does anyone have any other potential use cases or how it would be handled?

Ender IO has a block that prevents teleporting. It works for entities that fire the EnderTeleportEvent (Endermen/Shulkers) and modded teleport that fires Ender IO's TeleportEntityEvent.

I realize that Forge is coded very different then Spigot, so I'm gonna close this as not-possible.

It is not possible indeed.

Was this page helpful?
0 / 5 - 0 ratings