Skip to content

AStages Dimension Restriction

Kessy edited this page May 31, 2026 · 13 revisions

AStages Dimension Restriction

Overview

Dimension Restrictions enable you to control player access to specific dimensions within the game world. These restrictions can be applied to teleportation, allowing for customized progression paths, lore-driven gameplay, or restricted areas for events or challenges.


Methods

Method Description Parameters Returns
AStages.addRestrictionForDimension(id, stage, dimension) Create and add generic dimension restriction. id: arbitrary string used as identifier.
stage: progression stage.
dimension: dimension to be restricted.
ADimensionRestriction

Added Timers!

Caution

All informations in this section must be referred to versione above 1.2.0!

A brand new way to interact with dimension was added! Now developers, rather than totally restrict a dimension, can now set a timer for exploring that and a maximum number of access to the dimension!

AStages.addRestrictionForDimension("astages/dimension", "stage_dimension", "minecraft:the_nether")
    .setMaxStayTimer(ATime("20s")) // DEFAULT: null -> dimension completely restricted if this value is not set!
    .setMaxAccess(2) // DEFAULT: 1
    .setExpiredDimensionMessage(...) // You can also set a custom message when player CANNOT access this dimension!
    .setTimerFormatting("green") // DEFAULT: Gold

// ATime class accepts real-life hours, minutes and seconds, in this format (and so on!): 
ATime("30s")
ATime("1m 50s")
ATime("2m")
ATime("1h 5m")
ATime("1h 10m 20s")

There are also new commands for resetting and manipulating data!

'astages timer reset_all <players> <restriction_id>'
'astages timer reset_access <players> <restriction_id>'
'astages timer reset_timer <players> <restriction_id>'
'astages timer set_timer <players> <restriction_id> <value>' // Timers are in TICKS!
'astages timer set_access <players> <restriction_id> <value>'

Examples

Basic Usage

// Server Script Folder -> file.js (arbitrary file name).
AStages.addRestrictionForDimension("astages/dimension", "stage_dimension", "minecraft:the_nether")

Properties

Note

You don't need to set all properties for each restriction: changes should be done only when you want to modify default values!

// Server Script Folder -> file.js (arbitrary file name).
AStages.addRestrictionForDimension("astages/dimension", "stage_dimension", "minecraft:the_nether")
    .setBidirectional(false) // restrict go to and come from the dimension restricted
    .setDimensionMessage(dimension => Component.literal("Custom message for dimension ").append(dimension).withStyle("green"))
    .setLeaveDimensionMessage(dimension => ...)

Documentation:

  1. Home

  2. Stages
    - Usage
    - Utils

  3. Restrictions
    - Crop
    - Dimension
    - Effect
    - Enchant
    - Item (Old)
    - Loot
    - Mob
    - Ore
    - Pet
    - Recipe
    - Region
    - Screen
    - Structure

  4. Addons
    - Curios API
    - Pufferfish Skill's

  5. Simple Restrictions (via commands)
    Brand new and intuitive way to add restriction!

  6. Developers
    - Plugin
    - Restrictions
    - Simple Restrictions
    - Stage System
    - Utils

  7. Q&A
    A place where questions are on the agenda!

  8. Changelogs
    Changelogs since 0.6.0 version!

  9. Version Comparisons

  10. What's Happened? (FLOP!)
    New code formatting is coming!

Clone this wiki locally