AntiPort

NOTE requires WorldGuard

This pluign is a simple and lightweight extension to the functionality of WorldGuard. It is a way for ops to disallow players from teleporting into or out of regions protected by WorldGuard. At the moment this is global (I'll add permissions and stuff like that later) for all players even ops and there are no commands to manage what regions and which settings to use. For now it is all done through the config file.

Each region can have one or more "rules" that matches the return from the PlayerTeleportEvent.getCause() method (COMMAND', 'END_PORTAL', 'ENDER_PEARL', 'NETHER_PORTAL', 'PLUGIN', 'UNKNOWN' or alternatively 'ALL' to match all conditions) to determine which methods of teleportion it should block.

Regions can be set to block teleporting into a region, out of a region or both and the result of a blocked teleport can be set to either 'LOCATION' meaning they will be redirected to a certain location or 'RETURN' meaning they will simply not be teleported, staying where they were when they tried to teleport.

When a teleportation event has been blocked the event is not cancelled, it actually finishes out by redirecting the destination to what you set it as, so fall damage from ender pearls will still happen etc etc. Once its blocked a customizable message will be sent to the player.

This is a very simple plugin but will be expanded on as needed. At the moment I am using it to block players from being able to cheat their way through an obstacle course by disabling the use of ender pearls and teleportation objects (like from my ChestBuilder mod, but anything that triggers a PlayerTeleportEvent will work). This can be used for a multitude of applications though. You can use it to block spawning in certain regions, again used right now to stop players from cheating. At the end of my obstacle course are buttons that give you money for completing the course, players could simply log out at the end, wait out the 18 hour timer and log back in to get money again without completing the course. When a player logs out in a protected zone they will be teleported to the location you set. It should be noted that if you are planning on blocking spawns, you should not use the RETURN mechanism as there wont be a return location on a spawn.

At the moment I haven't seen another mod that does this (in all honesty I haven't tried a whole lot of protection mods) and would like to see it built into WorldGuard eventually, but for now this is very light weight and works really well so have at it :)

Note that this can create infinite loops if you aren't careful, remember not to set a location to a region that is blocked for incoming teleports etc.

Future Plans

  • Implement commands to manage regions and settings
  • Implement permissions
  • Add a setting to choose between redirecting the teleport effect or creating a new one (to avoid other effects ie: ender pearl fall damage)

Comments

  • To post a comment, please or register a new account.
Posts Quoted:
Reply
Clear All Quotes

About This Project

Categories

Members

Recent Files