This CMI function allows you to create portals through which you can execute commands on the players that cross them.

Portals support specialised commands.

To create a portal, you need a wooden shovel (default selection tool)cmi.command.portals and cmi.select permission.

1. Now you select the area (like worldedit) in which you want to create the portal. The selected area is highlighted by particles.

2. Now you have to do this command: /cmi portals new [Name]. Example: /cmi portals new Test1
3. Now you have to set the destination point, where the player will be teleport.

4. Once this is done, we can customize the portal. Just write in chat /cmi portals edit Test1 and a GUI will open where we can choose:
  • Enable/disable the portal
  • Redefine area from current selection
  • Enable/disable particles
  • Particle type (36 different type)
  • Particle amount
  • Percentage of sides shrieked particles
  • Activation range of particles
  • Teleport to portal location
  • Teleport to portal target location
  • Choose if perform commands without valid teleport location or not
  • Edit portal commands
  • Set teleport location
  • Require predefined permission node
  • Show message if permission is missing to use that portal
  • Remove portal

5. Now let’s see how to add commands. Click on the black wool on the bottom.

6. Click on + sign to add new command, which will wait until you enter new command into chat window. Don’t start with / as regular commands, simply write basic command. [playerName] variable can be used to include players who interacted name. Enter new command into chat and press enter.

7. Here it is, now who will enter in that portal will be teleported and the fly will be removed. If we want we can remove the command that gives the effect of blindness by clicking on the X.

8. Here’s how a portal is saved in the Portals.yml file. I prefer to manage portal commands through the file.

  Test1:
    Loc: 358.0:64.0:77.0:358.0:67.0:81.0
    enabled: true
    effect: reddust
    showParticles: true
    Tp:
      ==: org.bukkit.Location
      world: world
      x: 370.6645173225757
      y: 64.0
      z: 79.38387030052189
      pitch: 2.5499883
      yaw: -268.79987
    particleAmount: 20
    particleHide: 0
    activationRange: 16
    commandsWithoutTp: false
    commands:
    - cmi effect [playerName] blindness 2 1 -s
    - cmi fly [playerName] false
ATTENTION

In the config file are automatically assigned cmi effect [playerName] blindness 2 1 -s If you want to remove it, just replace it with none.

Portals:
# Defines in milliseconds how often to check if player entered portal or not
# Bigger numbers can help slightly lower server load but small portals, 1 block depth without back wall can be passed through without teleportations if player moves fast enought
CheckInterval: 300
# Defines in milliseconds how often to check if player entered portal range for particles to apear
CheckParticleInterval: 500
# Perform commands on teleport or not
PerformCommands: true
# Commands to be performed on teleport event
Commands:
- cmi effect [playerName] blindness 2 1 -s
EXTRA
  • Portals will work over bungeecord network and you can teleport players across your servers. How to setup portal? It cant be simpler. Make portal, open portal UI, click on set location button and you will get message in chat box. Travel to desired location, same server or on bungee (both servers should have CMI) and click on that message. You are done. Thats it… Travel to location and click on chat. No commands, nothing. Just like that.
  • Portal commands will work over bungee network and will be applied after player is teleported.
  • Too add custom sound played while player enters the portal add this to the portal.yml command section. 
    Code (Text):
        commands:
        – cmi effect [playerName] blindness 2 1 -s
        – execute [playerName] ~ ~ ~ /playsound ENTITY.ENDERMEN.TELEPORT player [playerName]

    Note: Sound names can be different based on your Minecraft version.

  • You can see all portals, in order of proximity, doing
    Code (Text):
     /cmi portals
  • You can add as many commands as you want and specialized commands can be utilized.