Playroom Projects' - DimLock

概览
DimLock 是一款轻量级实用模组,通过引入锁定状态来限制对维度传送门的访问。当传送门被锁定时,除非满足所需条件,否则玩家将被禁止进入。该模组旨在用于受控的游戏场景,特别是在结构化的整合包和多玩家环境中。
DimLock 是 Playroom Project 整合包开发的一系列模组之一,专为与该整合包的进度系统集成而构建。
核心功能
DimLock 通过拦截传送门的使用并在传送发生前验证访问权限来运作。它不修改传送门的建造或激活方式,仅决定玩家是否允许通过它们进行旅行。
传送门可以在锁定和解锁状态之间切换。当处于锁定状态时,任何尝试使用该传送门的行为都会被拒绝,除非满足定义的必要条件。
主要特性
传送门使用限制
在传送门被锁定时阻止玩家通过传送门进行传送,并保持传送门创建和结构机制不变。
支持 & 已测试的传送门
- 主要围绕原版传送门行为设计
- 经过测试并确认兼容:
- 兼容性取决于模组如何实现传送门传送逻辑
锁定状态系统
- 二元状态系统:
- 状态在玩家与传送门交互的瞬间进行检查
基于条件的访问控制
- 根据简单的预定义条件授予访问权限
- 旨在实现确定性的进度控制
- 避免复杂或动态的权限系统
服务端强制实施
- 所有验证均发生在服务端
- 防止客户端绕过
- 确保一致的多玩家体验
视觉反馈
- 在传送门被锁定时提供清晰的指示
- 设计上保持与游戏视觉风格的一致性
环境 & 兼容性
使用场景
- 在基于进度的整合包中管控维度访问
- 控制玩家何时可以进入模组添加的维度
- 防止服务器上的过早或非预期探索
设计范围
DimLock 专注于狭窄且可预测的功能集:
- 无自定义传送门系统
- 无高级权限框架
- 最小化配置复杂度
配置文件
配置文件
# 此文件设计为便于复制/粘贴使用。请使用示例并替换 ID。
# "COMMAND": 通过运行 /access <dimension> 获得永久访问权限(需要 2 级权限等级)。
# "XP": 访问至少需要 X 经验值。consume=true 每次进入时扣除点数。consume=false 仅进行检查。
# "LVL": 访问至少需要 X 经验等级。consume=true 每次进入时扣除等级。consume=false 仅进行检查。
# "KEY_HAVE": 每次进入都需要物品栏中存在钥匙物品。consume=true 每次进入时消耗 1 个钥匙。consume=false 仅检查物品栏。
# "KEY_USE": 通过使用钥匙物品右键点击配置的方块来获得永久访问权限。钥匙总是会被消耗一次。
# "ADVANCEMENT": 当完成指定的进度时获得永久访问权限。
# "denyMessage": 可选。如果省略,则使用通用消息。
# "useTargetTag": 可选。用于 KEY USE 的方块标签。默认为 playroom-projects-dimlock:key_use_targets。
# "useTargetBlocks": 可选。当多个维度共享同一钥匙物品时,用于 KEY USE 的显式方块列表。无默认值。
# 示例
# COMMAND 示例:
"minecraft:the_end": {
"type": "COMMAND",
"denyMessage": "末地已锁定。请管理员解锁。"
}
# XP 示例:
"minecraft:the_nether": {
"type": "XP",
"xp": {
"points": 500,
"consume": true
},
"denyMessage": "下界每次进入需要 500 XP 点数。"
}
# LVL 示例:
"minecraft:the_nether": {
"type": "LVL",
"lvl": {
"levels": 30,
"consume": false
},
"denyMessage": "进入下界需要 30 级。"
}
# KEY HAVE 示例:
"twilightforest:twilight_forest": {
"type": "KEY",
"key": {
"mode": "HAVE",
"item": "minecraft:diamond",
"consume": false
},
"denyMessage": "你必须携带钻石才能进入。"
}
# KEY USE 示例:
"minecraft:the_end": {
"type": "KEY",
"key": {
"mode": "USE",
"item": "minecraft:echo_shard",
"consume": true,
"useTargetTag": "playroom-projects-dimlock:key_use_targets",
"useSuccessMessage": "访问已解锁。"
},
"denyMessage": "在传送门上使用道具以解锁访问权限。"
}
# 使用相同钥匙的 KEY USE 示例:
"deeperdarker:otherside": {
"type": "KEY",
"key": {
"mode": "USE",
"item": "minecraft:echo_shard",
"consume": true,
"useTargetBlocks": ["deeperdarker:otherside_portal"],
"useSuccessMessage": "访问已解锁。"
},
"denyMessage": "在传送门上使用道具以解锁访问权限。"
}
# ADVANCEMENT 示例:
"minecraft:the_nether": {
"type": "ADVANCEMENT",
"advancement": {
"id": "minecraft:story/mine_diamond",
"unlockMessage": "下界已解锁。"
},
"denyMessage": "完成进度以进入。"
}
从这里开始,您可以设置维度限制
配置
"dimensions": {
"minecraft:the_nether": {
"type": "KEY",
"key": {
"mode": "USE",
"item": "additionaladditions:depth_meter",
"consume": true,
"useTargetTag": "playroom-projects-dimlock:key_use_targets",
"useSuccessMessage": "您现在可以访问下界了"
},
"denyMessage": "在传送门上使用深度计以解锁下界。"
}
}
</details>
Playroom Projects' - DimLock

Overview
DimLock is a lightweight utility mod that restricts access to dimension portals by introducing a lock state. When a portal is locked, players are prevented from entering it until the required condition is met. The mod is designed for controlled gameplay scenarios, especially within structured modpacks and multiplayer environments.
DimLock is part of a collection of mods developed for the Playroom Project modpack and is built to integrate with its progression systems.
Core Functionality
DimLock operates by intercepting portal usage and validating access before teleportation occurs. It does not modify how portals are built or activated, only whether a player is allowed to travel through them.
Portals can be toggled between locked and unlocked states. When locked, any attempt to use the portal is denied unless the defined requirement is satisfied.
Key Features
Portal Usage Restriction
Blocks player teleportation through portals when locked, and leaves portal creation and structure mechanics unchanged.
Supported & Tested Portals
- Designed primarily around vanilla portal behavior
- Tested and confirmed working with:
- Compatibility depends on how mods implement portal teleportation logic
Lock State System
- Binary state system:
- Locked (blocked access)
- Unlocked (normal behavior)
- State is checked at the moment of portal interaction
Condition-Based Access
- Access is granted based on simple predefined conditions
- Intended for deterministic progression control
- Avoids complex or dynamic permission systems
Server-Side Enforcement
- All validation occurs server-side
- Prevents client-side bypass
- Ensures consistent multiplayer behavior
Visual Feedback
- Provides a clear indication when a portal is locked
- Designed to remain visually consistent with the game
Environment & Compatibility
- Server-side only
- Works in singleplayer too
Use Cases
- Gatekeeping dimension access in progression-based modpacks
- Controlling when players can enter modded dimensions
- Preventing early or unintended exploration on servers
Design Scope
DimLock focuses on a narrow, predictable feature set:
- No custom portal systems
- No advanced permission frameworks
- Minimal configuration complexity
Configurations
Config file
# This file is designed to be copy/paste friendly. Use the examples and replace ids.
# "COMMAND": Permanent access is granted by running /access <dimension> (requires permission level 2).
# "XP": Access requires at least X experience points. consume=true removes points each entry. consume=false only checks.
# "LVL": Access requires at least X experience levels. consume=true removes levels each entry. consume=false only checks.
# "KEY_HAVE": Access requires having the key item in inventory each entry. consume=true removes 1 key each entry. consume=false only checks inventory.
# "KEY_USE": Permanent access is granted by right-clicking a configured block with the key item. Key is always consumed once.
# "ADVANCEMENT": Permanent access is granted when the specified advancement is completed.
# "denyMessage": Optional. If omitted a generic message is used.
# "useTargetTag": Optional. Block tag used for KEY USE. Default is playroom-projects-dimlock:key_use_targets.
# "useTargetBlocks": Optional. Explicit block list for KEY USE when multiple dimensions share the same key item. No default.
# Examples
# COMMAND example:
"minecraft:the_end": {
"type": "COMMAND",
"denyMessage": "End is locked. Ask an admin to unlock it."
}
# XP example:
"minecraft:the_nether": {
"type": "XP",
"xp": {
"points": 500,
"consume": true
},
"denyMessage": "Nether requires 500 XP points each entry."
}
# LVL example:
"minecraft:the_nether": {
"type": "LVL",
"lvl": {
"levels": 30,
"consume": false
},
"denyMessage": "Nether requires level 30 to enter."
}
# KEY HAVE example:
"twilightforest:twilight_forest": {
"type": "KEY",
"key": {
"mode": "HAVE",
"item": "minecraft:diamond",
"consume": false
},
"denyMessage": "You must carry a diamond to enter."
}
# KEY USE example:
"minecraft:the_end": {
"type": "KEY",
"key": {
"mode": "USE",
"item": "minecraft:echo_shard",
"consume": true,
"useTargetTag": "playroom-projects-dimlock:key_use_targets",
"useSuccessMessage": "Access unlocked."
},
"denyMessage": "Use the key on the portal to unlock access."
}
# KEY USE example with same key:
"deeperdarker:otherside": {
"type": "KEY",
"key": {
"mode": "USE",
"item": "minecraft:echo_shard",
"consume": true,
"useTargetBlocks": ["deeperdarker:otherside_portal"],
"useSuccessMessage": "Access unlocked."
},
"denyMessage": "Use the key on the portal to unlock access."
}
# ADVANCEMENT example:
"minecraft:the_nether": {
"type": "ADVANCEMENT",
"advancement": {
"id": "minecraft:story/mine_diamond",
"unlockMessage": "Nether unlocked."
},
"denyMessage": "Complete the advancement to enter."
}
# From here you can fill out your restrictions for dimensions
# Config
"dimensions": {
"minecraft:the_nether": {
"type": "KEY",
"key": {
"mode": "USE",
"item": "additionaladditions:depth_meter",
"consume": true,
"useTargetTag": "playroom-projects-dimlock:key_use_targets",
"useSuccessMessage": "You now have access to Nether"
},
"denyMessage": "Use the Depth Meter on the portal to unlock the Nether."
}
}
评论 0
登录后参与评分
还没有评论,来抢沙发吧