Skip to content

Developer Api for creating custom portals to any dimension

License

Notifications You must be signed in to change notification settings

kyrptonaught/customportalapi

Repository files navigation

Custom Portal Api

Library mod allowing developers to easily create portals to their custom dimensions. These custom portals will function exactly like nether portals except being fully customizable. You can control the frame block, portal block or tinting of the default, ignition source, and destination and more!

Some example of portals
p p

Usage:

Versions:

1.16 Dynamic XML Badge
1.17 Dynamic XML Badge
1.18 Dynamic XML Badge
1.19/1.19.1/1.19.2 Dynamic XML Badge
1.19.3 Dynamic XML Badge
1.19.4 Dynamic XML Badge
1.20/1.20.1 Dynamic XML Badge
1.20.2 Dynamic XML Badge
1.20.4 Dynamic XML Badge
1.20.5 Dynamic XML Badge
1.20.6 Dynamic XML Badge
1.21/1.21.1 Dynamic XML Badge

Add the repository to your build.gradle.

repositories {
  // ... any other repositories in this block, as needed
  maven {url = "https://maven.kyrptonaught.dev"}
}

Add the dependency to your build.gradle.

dependencies {
  // ... your other dependencies in this block, as needed
  modImplementation 'net.kyrptonaught:customportalapi:<version>'
  include 'net.kyrptonaught:customportalapi:<version>'
}

Now onto creating and registering the portal itself, this is very simple thanks to the CustomPortalBuilder class. We will make use of this in your mod initializer.

The following is a very simple portal that will take us to the end, and is lit by right clicking the frame with an Eye of Ender.

CustomPortalBuilder.beginPortal()  
        .frameBlock(Blocks.DIAMOND_BLOCK)  
        .lightWithItem(Items.ENDER_EYE)  
        .destDimID(Identifier.of("the_end"))  
        .tintColor(45,65,101)  
        .registerPortal();

A nether portal would be registered as follows:

CustomPortalBuilder.beginPortal()  
        .frameBlock(Blocks.OBSIDIAN)  
        .destDimID(Identifier.of("the_nether"))  
        .tintColor(131, 66, 184)  
        .registerPortal();

CustomPortalBuilder is filled with plenty of methods to customize the functionality of your portal, all of which are documented in the class.

Some noteworthy methods to mention:

  • lightWithWater/Item/Fluid - These allow you to control how the portal is lit.
  • onlyLightInOverworld - Only allow the portal to be used in the overworld to your destination of choice
  • flatPortal - Flat Portal similar to the End or the Twilight Forest portal.

About

Developer Api for creating custom portals to any dimension

Resources

License

Stars

Watchers

Forks

Languages