-
Notifications
You must be signed in to change notification settings - Fork 9
AStages Structure Restriction
Caution
Everything written in this page can be referred only to versions above 0.7.0!
Structure Restrictions allow you to control access to or interaction with specific structures within the game. This includes limiting entry, preventing interactions with blocks or entities within the structure, or restricting the explosion that can happen. These restrictions are useful for creating progression-based exploration, protecting important areas, or ensuring that specific structures are only accessible under certain conditions.
| Method | Description | Parameters | Returns |
|---|---|---|---|
AStages.addRestrictionForStructure(id, stage, structure...) |
Create and add generic structure restriction. |
id: arbitrary string used as identifier.stage: progression stage.structure: all structures to be restricted. |
AStructureRestriction |
// Server Script Folder -> file.js (arbitrary file name).
AStages.addRestrictionForStructure("astages/structure", "stage_structure", "minecraft:pillager_outpost")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.addRestrictionForStructure("astages/structure", "stage_structure", "minecraft:pillager_outpost")
.setCanAttackEntities(false)
.setCanEnter(false) @NotYetImplemented
.setCanInteract(false)
.setCanBlockBePlaced(false)
.setCanBlockBeBroken(false)
.setMakeExplosionsAffectBlocks(false)
.setMakeExplosionsAffectEntities(false)
.addAllowedBreakableBlocks('iron_bars') // EXAMPLE: for demonstration purposes only!
.addAllowedPlaceableBlocks('cobblestone', 'stone_bricks') // EXAMPLE: for demonstration purposes only!
.addAllowedInteractableBlocks('chest') // EXAMPLE: for demonstration purposes only!
.addAllowedBreakableStates(Blocks.COBBLESTONE.defaultBlockState()) // EXAMPLE: for demonstration purposes only!
.addAllowedPlaceableStates(Blocks.COBBLESTONE.defaultBlockState()) // EXAMPLE: for demonstration purposes only!
.addAllowedInteractableStates(Blocks.CHEST.defaultBlockState()) // EXAMPLE: for demonstration purposes only!
.addAllowedTargetableEntities('minecraft:pillager') // EXAMPLE: for demonstration purposes only!
.setAttackMessage(structure => Component.literal("Custom message for structure ").append(structure.getHoverName()).withStyle("green"))
.setInteractMessage(structure => ...)
.setEnterMessage(structure => ...)
.setPlaceMessage(structure => ...)
.setBreakMessage(structure => ...)Documentation:
-
Restrictions
- Crop
- Dimension
- Effect
- Enchant
- Item (Old)
- Loot
- Mob
- Ore
- Pet
- Recipe
- Region
- Screen
- Structure -
Addons
- Curios API
- Pufferfish Skill's -
Simple Restrictions (via commands)
Brand new and intuitive way to add restriction! -
Developers
- Plugin
- Restrictions
- Simple Restrictions
- Stage System
- Utils -
Q&A
A place where questions are on the agenda! -
Changelogs
Changelogs since 0.6.0 version! -
What's Happened? (FLOP!)
New code formatting is coming!