BentoBox icon indicating copy to clipboard operation
BentoBox copied to clipboard

API: General Teleportation Util Method

Open BONNe opened this issue 4 years ago • 1 comments

Description

Is your feature request related to a problem?

Some addons use teleportations methods, like warps, and also BentoBox core uses a lot of teleportation for players. As we know, some positions may become dangerous to teleport. F.e. if a position is now in lava or void. So BentoBox core has a lot of different approaches that solve this issue and avoids teleporting players in nowhere. However, there is none general method, that could manage it.

Describe the solution you'd like us to implement.

A Util.safeTeleportation(Entity, Location, TeleportCause) that manages most common used protection variants. This method should check if the location is safe, and if not, find the nearest safe block. BentoBox already has everything build in but just not in single command call.

Additional context

This is just a comfort improvement, so everything could go through a single method call.

BONNe avatar Jun 18 '20 15:06 BONNe

Maybe not in Util? I'll think about it.

Poslovitch avatar Jun 18 '20 16:06 Poslovitch