跳到主要内容

阻止能力

这些能力会阻止特定行为。


origins:prevent_being_used​

阻止其他实体与玩家互动。

字段类型默认值描述
bientity_action双实体动作可选互动被阻止时执行的动作
bientity_condition双实体条件可选必须满足才会阻止该互动的条件
示例
{
"type": "origins:prevent_being_used",
"bientity_action": {
"type": "origins:source_action",
"action": {
"type": "origins:execute_command",
"command": "title @s actionbar {\"text\": \"Entity cannot be interacted with!\", \"color\": \"red\"}"
}
}
}

此示例将阻止其他玩家“使用”(右键点击)拥有该能力的实体,并提示他们“无法与该实体互动”。

origins:prevent_block_place​

阻止放置特定方块。

字段类型默认值描述
block_condition方块条件可选被阻止放置的方块的条件

origins:prevent_block_selection​

阻止选中(挖掘轮廓)特定方块。

字段类型默认值描述
block_condition方块条件可选被阻止选中的方块的条件
示例
{
"type": "origins:prevent_block_selection",
"block_condition": {
"type": "origins:in_tag",
"tag": "origins:cobwebs"
},
"condition": {
"type": "origins:sneaking",
"inverted": true
}
}

此示例将阻止选中蜘蛛网(包括蛛形纲能力中的临时蜘蛛网方块),使玩家可以直接打穿它们,除非玩家正在潜行。

origins:prevent_block_use​

阻止使用(右键点击)特定方块。

字段类型默认值描述
block_condition方块条件可选被阻止使用的方块的条件
示例
{
"type": "origins:prevent_block_use",
"block_condition": {
"type": "origins:block_id",
"block": "minecraft:crafting_table"
}
}

此示例将阻止玩家使用工作台。

origins:prevent_breeding​

不稳定

此能力目前不稳定,可能无法按预期工作。如果遇到任何问题,请报告。

阻止能力持有者让匹配的动物繁殖。

字段类型默认值描述
bientity_condition双实体条件可选以玩家为执行者、以父母为目标的条件
bientity_action双实体动作可选阻止繁殖时执行的动作
prevent_follow布尔值false保留的跟随行为选项

origins:prevent_death​

阻止玩家死亡。

字段类型默认值描述
damage_condition伤害条件可选被阻止致死的伤害类型条件
entity_action实体动作可选阻止死亡时执行的动作
示例
{
"type": "origins:prevent_death",
"entity_action": {
"type": "origins:and",
"actions": [
{
"type": "origins:remove_effect"
},
{
"type": "origins:apply_effect",
"effects": [
{
"effect": "minecraft:regeneration",
"amplifier": 1,
"duration": 900
},
{
"effect": "minecraft:fire_resistance",
"duration": 800
},
{
"effect": "minecraft:absorption",
"amplifier": 1,
"duration": 100
}
]
}
]
}
}

此示例将始终阻止实体死亡,然后施加与不死图腾相同的效果,例如:清除实体身上的所有状态效果,然后施加生命恢复 II、抗火 I 和伤害吸收 I。

origins:prevent_elytra_flight​

阻止激活鞘翅飞行。

字段类型默认值描述
entity_action实体动作可选鞘翅飞行被阻止时执行的动作
示例
{
"type": "origins:prevent_elytra_flight",
"entity_action": {
"type": "origins:execute_command",
"command": "tellraw @s {\"text\": \"You cannot glide from this height!\", \"color\": \"red\"}"
},
"condition": {
"type": "origins:in_block",
"block_condition": {
"type": "origins:height",
"comparison": "<=",
"compare_to": 64
}
}
}

此示例将在拥有该能力的实体位于 Y=64 或更低时显示警告,并阻止其使用鞘翅飞行。

origins:prevent_entity_collision​

阻止与特定实体发生碰撞。

字段类型默认值描述
bientity_condition双实体条件可选被阻止碰撞的实体的条件
示例
{
"type": "origins:prevent_entity_collision"
}

此示例将阻止拥有该能力的实体与其他实体发生碰撞。

origins:prevent_entity_render​

阻止渲染特定实体。

字段类型默认值描述
entity_condition实体条件可选被隐藏渲染的实体的条件
示例
{
"type": "origins:prevent_entity_render",
"entity_condition": {
"type": "origins:entity_type",
"entity_type": "minecraft:creeper"
},
"condition": {
"type": "origins:daytime"
}
}

此示例将使苦力怕在白天对拥有该能力的玩家不可见。

origins:prevent_entity_use​

阻止与特定实体互动。

字段类型默认值描述
bientity_action双实体动作可选互动被阻止时执行的动作
bientity_condition双实体条件可选被阻止互动的实体的条件
示例
{
"type": "origins:prevent_entity_use",
"bientity_action": {
"type": "origins:source_action",
"action": {
"type": "origins:execute_command",
"command": "title @s actionbar {\"text\": \"Cannot interact with pigs!\", \"color\": \"red\"}"
}
},
"bientity_condition": {
"type": "origins:target_condition",
"condition": {
"type": "origins:entity_type",
"entity_type": "minecraft:pig"
}
}
}

此示例将阻止拥有该能力的玩家与猪互动(同时也会阻止那些允许你与猪互动的能力),并对尝试与猪互动的实体执行一个 Execute Command(实体动作类型)。

origins:prevent_feature_render​

配置是否在拥有该能力的实体上渲染指定的实体特征。

字段类型默认值描述
armor布尔值true若为 true,则渲染穿着的盔甲;若为 false,则隐藏。
cape布尔值true若为 true,则渲染披风;若为 false,则隐藏。
elytra布尔值true若为 true,则渲染穿着的鞘翅;若为 false,则隐藏。
held_item布尔值true若为 true,则渲染手持物品;若为 false,则隐藏。
示例
{
"type": "origins:prevent_feature_render",
"armor": false,
"cape": false,
"elytra": false,
"held_item": false
}

此示例将隐藏拥有该能力的实体所穿着的盔甲、披风、鞘翅以及手持物品。

origins:prevent_game_event​

阻止检测到特定游戏事件(例如幽匿感测体)。

字段类型默认值描述
event标识符 或 List可选要阻止的游戏事件 ID
entity_action实体动作可选事件被阻止时执行的动作
示例
{
"type": "origins:prevent_game_event",
"event": "minecraft:hit_ground",
"entity_action": {
"type": "origins:execute_command",
"command": "say donk"
}
}

此示例将阻止拥有该能力的实体发出 minecraft:hit_ground 游戏事件,该事件通常在坠落着地时发出。

origins:prevent_item_pickup​

阻止拾取特定物品。

字段类型默认值描述
item_condition物品条件可选被阻止拾取的物品的条件
priority整数0该能力的优先级,优先级更高的能力先执行

origins:prevent_item_use​

阻止使用特定物品。

字段类型默认值描述
item_condition物品条件可选被阻止使用的物品的条件
示例
{
"type": "origins:prevent_item_use",
"item_condition": {
"type": "origins:ingredient",
"ingredient": {
"tag": "origins:meat"
}
}
}

此示例会阻止玩家使用任何属于 origins:meat 物品标签的物品。

origins:prevent_sleep​

阻止玩家在床上睡觉。

字段类型默认值描述
block_condition方块条件可选被阻止使用的床的条件
message文本组件可选阻止睡觉时显示的自定义消息
set_spawn布尔值true该床是否仍能设置玩家的出生点
priority整数0该能力的优先级,优先级更高的能力先执行
示例
{
"type": "origins:prevent_sleep",
"message": "It's not hot enough for you to sleep",
"condition": {
"type": "origins:on_fire",
"inverted": true
}
}

此示例将阻止玩家睡觉,除非玩家正在燃烧。

origins:prevent_sprinting​

阻止玩家疾跑。

示例
{
"type": "origins:prevent_sprinting",
"condition": {
"type": "origins:food_level",
"compare_to": 12,
"comparison": "<="
}
}

此示例将在玩家的饥饿值等于或低于 6 个鸡腿时阻止其疾跑。