Minecraft 26.3, 26.2
Custom Portal Generation (Datapacks)
Create custom see-through portals for any dimension using Minecraft datapacks with schema imm_ptl:v1, verified portal forms, item triggers, and working JSON examples.
Custom Portal Generation lets modpack creators, server admins, and datapack authors define new survival-activatable see-through portals linking any vanilla, modded, or DimLib dimension using JSON files inside a standard Minecraft datapack.
Make sure enableDatapackPortalGen is true (the default) in config/immersive_portals.json.
Datapack File Location
Place each portal definition JSON inside your datapack at:
- Modern path (recommended):
data/<namespace>/immersive_portals/custom_portal_generation/<portal_name>.json - Legacy path (also supported):
data/<namespace>/custom_portal_generation/<portal_name>.json
Both registry paths are loaded by Immersive Portals Continued in Minecraft 26.2 and 26.3.
JSON Schema (imm_ptl:v1)
Every custom portal generation file uses "schema_version": "imm_ptl:v1" with the following top-level fields:
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
schema_version | string | Yes | Required | Must be "imm_ptl:v1". |
from | string[] | Yes | Required | List of source dimension IDs (e.g., ["minecraft:overworld"]). Supports "imm_ptl:any_dimension". |
to | string | Yes | Required | Destination dimension ID (e.g., "minecraft:the_nether"). Supports "imm_ptl:the_same_dimension". |
space_ratio_from | integer | No | 1 | Numerator/divisor coordinate ratio on the source side (for Overworld -> Nether, from: 8, to: 1). |
space_ratio_to | integer | No | 1 | Coordinate ratio on the destination side. Mapped position is pos * space_ratio_to / space_ratio_from. |
reversible | boolean | No | true | Automatically registers the reverse portal direction (to -> first from dimension) with swapped ratios and form. |
form | object | Yes | Required | Defines the frame geometry, blocks, and portal layout (type + form fields). |
trigger | object | Yes | Required | Defines how a player activates the portal (type + trigger fields). |
post_invoke_commands | string[] | No | [] | Commands executed as every generated portal entity immediately after spawning. |
commands_on_generated | string[][] | No | [] | Per-portal-index command lists (entry 0 runs on portal 0, entry 1 on portal 1, etc.). |
Supported Portal Forms (form.type)
Form type | Behavior | Key Fields |
|---|---|---|
imm_ptl:classical | Nether-portal-style frame matching exact shape & orientation; supports different frame blocks on source vs. destination. | from_frame_block, area_block, to_frame_block, generate_frame_if_not_found |
imm_ptl:heterogeneous | Nether-portal-style frame accepting block tags (such as #minecraft:planks); clones exact source frame blocks to the destination. | frame_block, area_block, generate_frame_if_not_found |
imm_ptl:try_hard_to_match | Diligent matching: links rotated, tilted, horizontal, or proportionally scaled frames (like adaptive Nether portals). | from_frame_block, area_block, to_frame_block, generate_frame_if_not_found |
imm_ptl:flipping_floor_square | Horizontal square floor portal (Twilight Forest style) with fixed side length, optional top decoration ring (up_frame_block), and bottom block check (bottom_block). | length, frame_block, area_block, optional up_frame_block, optional bottom_block |
imm_ptl:flipping_floor_square_new | Horizontal square floor portal of any square size using block tags and existing-frame search. | frame_block, area_block, generate_frame_if_not_found |
imm_ptl:scaling_square | Connects a square of size from_length to a square of size to_length, automatically applying scale to_length / from_length. | from_frame_block, area_block, to_frame_block, from_length, to_length, generate_frame_if_not_found |
imm_ptl:convert_conventional_portal | Converts an existing modded/vanilla non-immersive portal into an immersive portal when a player travels through it. | portal_block |
imm_ptl:one_way | Creates a breakable or unbreakable one-way portal frame (ideal when combined with post_invoke_commands to set a fixed destination). | frame_block, area_block, bi_faced, optional breakable (default true) |
Supported Triggers (trigger.type)
Trigger type | Behavior | Fields |
|---|---|---|
imm_ptl:use_item | Right-click inside or on the portal frame while holding the specified item. | item (item ID), optional consume (boolean, default false; never consumed in Creative). |
imm_ptl:throw_item | Toss the specified item (Q) into the portal interior area (e.g., water or lava pool). | item (item ID). |
imm_ptl:conventional_dimension_change | Fires automatically when a player changes dimensions through a conventional portal block (paired with imm_ptl:convert_conventional_portal). | (none) |
Verified Datapack Examples
All examples below are verified directly against Immersive Portals’ official datapack schemas and codecs.
1. Glowstone + Water Bucket Portal (imm_ptl:classical)
Builds a classic Aether-style glowstone frame activated by right-clicking with a Water Bucket:
{
"schema_version": "imm_ptl:v1",
"from": [
"minecraft:overworld"
],
"to": "custom:skyland",
"form": {
"type": "imm_ptl:classical",
"from_frame_block": "minecraft:glowstone",
"area_block": "minecraft:air",
"to_frame_block": "minecraft:glowstone",
"generate_frame_if_not_found": true
},
"trigger": {
"type": "imm_ptl:use_item",
"item": "minecraft:water_bucket"
}
}
2. Twilight-Style Floor Pool with Lightning (imm_ptl:flipping_floor_square)
A 2x2 water pool bordered by dirt/grass blocks topped with small flowers, activated by throwing a diamond into the water and striking lightning via post_invoke_commands:
{
"schema_version": "imm_ptl:v1",
"from": [
"minecraft:overworld"
],
"to": "custom:twilight",
"form": {
"type": "imm_ptl:flipping_floor_square",
"length": 2,
"frame_block": "#minecraft:bamboo_plantable_on",
"area_block": "minecraft:water",
"up_frame_block": "#minecraft:small_flowers",
"bottom_block": "#minecraft:bamboo_plantable_on"
},
"trigger": {
"type": "imm_ptl:throw_item",
"item": "minecraft:diamond"
},
"post_invoke_commands": [
"/summon minecraft:lightning_bolt ~ ~ ~"
]
}
3. Any-Wood Tag Portal (imm_ptl:heterogeneous)
Accepts any wood plank block via #minecraft:planks, clones the exact planks you built with onto the destination side, and triggers on right-click with a Compass:
{
"schema_version": "imm_ptl:v1",
"from": [
"minecraft:overworld"
],
"to": "custom:void_realm",
"form": {
"type": "imm_ptl:heterogeneous",
"frame_block": "#minecraft:planks",
"area_block": "minecraft:air",
"generate_frame_if_not_found": true
},
"trigger": {
"type": "imm_ptl:use_item",
"item": "minecraft:compass"
}
}
4. Asymmetric Frame & 1:8 Coordinate Ratio (space_ratio_from / space_ratio_to)
A Lapis Block frame in the Overworld that generates a Redstone Block frame in the destination with an 8x coordinate expansion:
{
"schema_version": "imm_ptl:v1",
"from": [
"minecraft:overworld"
],
"to": "custom:chaos",
"space_ratio_from": 1,
"space_ratio_to": 8,
"form": {
"type": "imm_ptl:classical",
"from_frame_block": "minecraft:lapis_block",
"area_block": "minecraft:air",
"to_frame_block": "minecraft:redstone_block",
"generate_frame_if_not_found": true
},
"trigger": {
"type": "imm_ptl:use_item",
"item": "minecraft:flint_and_steel"
}
}
5. Same-Dimension Scaled Linker (imm_ptl:try_hard_to_match)
Build two Diamond Block frames of matching proportions anywhere in the same dimension (imm_ptl:any_dimension -> imm_ptl:the_same_dimension) and ignite one with Flint and Steel to link them without generating extra frames:
{
"schema_version": "imm_ptl:v1",
"from": [
"imm_ptl:any_dimension"
],
"to": "imm_ptl:the_same_dimension",
"reversible": false,
"form": {
"type": "imm_ptl:try_hard_to_match",
"from_frame_block": "minecraft:diamond_block",
"area_block": "minecraft:air",
"to_frame_block": "minecraft:diamond_block",
"generate_frame_if_not_found": false
},
"trigger": {
"type": "imm_ptl:use_item",
"item": "minecraft:flint_and_steel"
}
}
6. Convert Conventional Modded Portals (imm_ptl:convert_conventional_portal)
Automatically converts a conventional portal block into an immersive see-through portal the first time a player walks through it:
{
"schema_version": "imm_ptl:v1",
"from": [
"minecraft:overworld"
],
"to": "minecraft:the_nether",
"form": {
"type": "imm_ptl:convert_conventional_portal",
"portal_block": "minecraft:nether_portal"
},
"trigger": {
"type": "imm_ptl:conventional_dimension_change"
}
}