Sable Hostile Takeover
给任何生物一个攻击你船只的理由,让它们为自己建立一片废土
教程可通过 Wiki 链接获取 ->
目录
概述
Sable 子层级为 Create Aeronautics 和 Create Submarine 生态系统中的飞船、飞艇、漫游车和其他载具提供动力,但在此之前,世界上没有任何东西能真正威胁到它们。敌对生物会径直走过正在被攻击的船只,箭矢会直接穿透船体,而处于围攻状态的基地可以放心地将舰队停泊在开阔水域中,无需有任何顾虑。
Sable Mob Interactions 改变了这一现状。它赋予原版生物以及其他模组的生物能够真正看到、锁定并伤害 Sable 子层级的能力,且无需该模组的作者知晓 Sable 的存在。
这不是一个针对单个生物的内容包。它是一个通用的交互层:任何达到备用层级的敌对生物都会获得一个针对子层级方块的真实、持久目标,并且其自身的原生攻击目标(近战、自定义武器系统或原作者编写的任何其他逻辑)会自然地对其发动攻击,使用生物真实的动画、声音和行为。
自 1.1.0 版本起,生物可以在轮子上反击。自定义载具作为物理子层级在世界中生成,由坐在 Create 座椅上的生物驾驶,四处行驶,追逐玩家并猎杀途中的一切障碍。
功能一览
- 原版生物,经过适当调整。 骷髅发射真实的箭矢。溺尸若手持三叉戟则会投掷。僵尸和大多数其他近战生物会击穿船体。苦力怕会在你的船只附近爆炸。守卫者会充能光束。末影人会偷走你的装饰物。
- 自动支持任意模组的生物。 通用的备用攻击目标让任何其他敌对生物拥有真实的目标并退后一步,让其自身的攻击 AI(近战、远程或完全自定义的武器逻辑)完成其余工作,零代码需求来自该模组的作者。
- 自动支持任意模组的投射物。 箭矢、三叉戟、子弹、炮弹,任何扩展了原版
Projectile 类的投射物在撞击时都能正确伤害子层级方块,无论它们是由哪个模组发射的。
- 生物驾驶载具。 汽车作为带有驾驶员的生物的物理子层级生成,通过“生物发射器”方块进行驾驶。
- 生成节点。 道路结构会在平坦生物群系的平整基座上生成,并自行填充汽车。
- 自带汽车。 将
.nbt 载具文件放入你的世界文件夹中,它们将根据你选择的层级加入生成池。
- 智能驾驶员。 飞行员会追逐、游荡、避开障碍物和其他车辆,远离水和悬崖,转弯时会减速,并在翻倒时恢复直立。
- 针对船只的锁定机制。 只有当子层级由真实的推进/结构部件(可配置的方块标签)构成且有玩家 nearby 时,它们才会成为有效目标,因此默认情况下闲置的玩家建筑和废弃的测试装置不会面临风险。
- 可选的深度兼容性。 如果安装了 Create: Big Cannons,其自身的方块护甲/硬度值会影响打破一个方块所需的打击次数。
- 完全可配置。 搜索半径、攻击范围、射速、命中阈值、苦力怕破坏、末影人盗窃、船只检测严格程度、载具层级、驾驶目标等均可配置。
工作原理
子层级方块并不存在于你看到的实际位置。Sable 将每个子层级的真实方块数据存储在世界中另一个隔离的区域,仅在游戏内的当前位置视觉上呈现它。本模组添加的每次交互(查找附近的方块、瞄准投射物、击穿船体)都会在原始存储空间和子层级的视觉呈现位置之间正确转换,因此生物和投射物会击中它们看似瞄准的确切位置。
伤害通过共享的命中计数器按方块跟踪,在方块实际破碎之前驱动 Minecraft 自身的裂纹进度叠加层,因此与船只的战斗看起来和感觉上与与其他结构的战斗相同。
生物驾驶载具
载具是普通的 Sable 子层级结构模板。当需要时,模组将模板放置在世界中,触发内部的物理装配器,找到 Create 座椅,并将飞行员安置在那里。飞行员通过“生物发射器”进行驾驶,该方块将生物的决策转化为载具的方向盘和油门控制。
- 汽车会校准自身方向盘和油门的转向方向,因此大多数建筑无需设置即可正确驾驶。
- 每个层级都有各自的
max_speed(最大速度)。
- 如果你离开区域或重新加载世界,飞行员会重生;如果飞行员死亡,汽车将留下残骸。
- 未能成功组装的汽车会变成残骸,而不是留下散落的方块。
生成节点
每个层级都有一个节点:一种道路结构,它在世界中生成,并在玩家靠近时在周围生成汽车。
- 节点位于带有自然收边坡度的平整基座上,因此不会与树木和山丘重叠。
- 基座会匹配周围环境:沙漠中为砂岩和沙,下界荒地(Badlands)中为压实泥土、红沙和陶瓦,雪原生物群系中为雪,多石海岸为砾石和石头,其他所有地方均为泥土和草方块。
- 节点仅生成在开阔生物群系(平原、沙漠、稀树草原、下界荒地和类似生物群系)中。该列表是一个可编辑的生物群系标签:
sablemobinteractions:vehicle_node_biomes。
- 节点遵循每个层级的环(
min_radius 和 max_radius),以世界原点为基准进行测量,并且会在陡峭地形和水边被跳过。
- 车辆仅放置在平坦、空旷的地面上,绝不会出现在树木内部或与其他车辆重叠。
/place structure 命令可用于放置节点,并忽略生物群系、环、平坦度和海平面检查,因此你可以将其放置在任意位置进行测试。
节点仅在新生成的区块中出现,因此现有世界将在你探索时陆续出现它们。
自定义车辆
将你自己的 .nbt 车辆文件放入 saves/<world>/vehicles/<tier>,例如 saves/<world>/vehicles/tier_1_scrap。它们将加入该层级的池子,并在文件更改时重新扫描。
- 内置车辆会在首次需要时被复制到一级文件夹中。如果你不希望它出现在你的池中,请从该文件夹中删除它。
- 如果某层级的文件夹为空,内置车辆会被再次安装,以确保该层级始终有可供刷新的内容。
- 车辆需要一个 Create 驾驶座供驾驶员使用,以及结构内的一个物理装配器方块。
- 红石链接频率对每辆刷新的车辆都是随机化的,因此同一款车的两个副本永远不会互相干扰。
- 自定义车辆不会自动在不同世界之间复制。
车辆层级
层级是位于 data/sablemobinteractions/vehicle_tiers/ 中的 JSON 文件,每个层级一个(包含 tier_1_scrap 到 tier_5_boss)。一个层级控制以下内容:
- 其刷新的环(
min_radius, max_radius)及其站点的稀有度
- 每个站点出现的车辆数量以及它们之间的最小间距
- 最高速度
- 哪些生物担任驾驶员
- 驾驶员使用的驾驶目标,按优先级排序
structures 列表用于数据包的自定义车辆。将其保留为 [] 以仅使用世界 vehicles 文件夹中的车辆。
驾驶目标
目标按照层级 JSON 中列出的顺序运行。第一个希望获得控制权的目标将控制车辆的方向。
| 目标 |
功能 |
chase |
朝向目标玩家行驶,在距离过近时会绕行并后退 |
wander |
在没有目标可追逐时漫无目的地行驶 |
avoid |
绕过障碍物和其他车辆 |
avoid_water |
避开深水区和岩浆 |
avoid_cliffs |
避开大型悬崖落差 |
slow_turn |
在急转弯前减速,以减少车辆翻覆的可能性 |
stay_upright |
当车辆倾斜时降低速度,并将已翻覆且停止的车辆扶正 |
unstick |
倒车以脱困 |
如果你拥有来自旧版本的自定义层级 JSON 文件,请在 unstick 之前添加 avoid_water、avoid_cliffs、slow_turn 和 stay_upright。
命令
/sablemobinteractions vehicles 列出受追踪的车辆、其状态及驾驶员
/sablemobinteractions customcars 列出每个层级找到的自定义车辆
/sablemobinteractions clearvehicles 移除模组生成的所有车辆,但不会移除玩家建造的车辆(需要 SableCat)
/sablemobinteractions debugdrive <true|false> 打印每个驾驶员的思维逻辑
配置
可通过游戏内 Mods → Sable Mob Interactions → Config 访问,或直接编辑 sablemobinteractions-common.toml。包括:
- 每个生物搜索半径、攻击范围和开火冷却时间
- 破坏方块所需的初始命中次数,支持可选的硬度缩放
- 子层级变为可攻击目标所需的前置玩家存在范围
- 切换开关:是否要求具备船只关键方块,子层级才可被攻击
- 独立切换 Ghast 破坏和末影人偷窃功能
- 用于扩展可窃取物品或船只关键方块的模组命名空间和方块标签
车辆行为在层级 JSON 文件中按层级配置,节点生物群系则在生物群系标签中配置。
基于此模组开发
希望让你的生物拥有更紧密、专门针对攻击子层级的控制,而不是依赖通用的后备方案?在你的生物实体类上实现 SubLevelAttacker 接口:
public interface SubLevelAttacker {
void attackSubLevelBlock(Vec3 targetWorldPos, SubLevel subLevel, BlockPos localPos);
default double getSubLevelAttackRange() { return 15.0; }
default int getSubLevelAttackCooldownTicks() { return 40; }
}
任何实现了此接口的生物都会被自动识别,无需你在端点进行注册。
依赖项
- Sable(必需)
- SableCat 1.0.3 或更高版本(必需,它提供了本模组所依赖的性能优化和车辆清理功能)
- Create(必需,车辆使用 Create 驾驶座)
- Simulated(必需,物理装配器,可将刷新的车辆转化为子层级)
- Create Connected(必需,内置车辆使用其变速箱)
- Offroad(必需,内置车辆使用其轮胎)
其余所有内容均为可选。Create Aeronautics、Create Submarine 和 Create: Big Cannons 仅在存在时用于增强特定行为,即使没有它们,本模组也能完全正常运行。
Sable Hostile Takeover
Give Any Mob a Reason to Attack Your Ships, and Let Them Build a Wasteland of Their Own
Tutorial avaliable via the wiki link ->
Table of Contents
Overview
Sable sub-levels power ships, airships, rovers, and other vehicles across the Create Aeronautics and Create Submarine ecosystem, but until now, nothing in the world could actually threaten them. Hostile mobs walked straight past a ship under attack, arrows sailed clean through hulls, and a besieged base could park its fleet in open water without a second thought.
Sable Mob Interactions changes that. It gives vanilla mobs, and any other mod's mobs, the ability to genuinely see, target, and damage Sable sub-levels, without requiring that mod's author to know Sable even exists.
This isn't a per-mob content pack. It's a generic interaction layer: any hostile mob that reaches the fallback tier gets a real, persistent target on a sub-level block, and its own native attack goals (melee, custom weapon systems, whatever the original author wrote) fire naturally against it, using the mob's real animations, sounds, and behavior.
As of 1.1.0 the mobs can fight back on wheels. Custom vehicles spawn out in the world as physics sub-levels, piloted by mobs sitting in Create seats, driving around, chasing players and hunting down anything in their way.
Features at a Glance
- Vanilla mobs, properly tuned. Skeletons fire real arrows. Drowned throw tridents if they're holding one. Zombies and most other melee mobs punch through hulls. Creepers explode near your vessel. Guardians charge a beam. Endermen make off with your décor.
- Any mod's mobs, automatically. A generic fallback goal gives any other hostile mob a real target and steps back, letting its own attack AI (melee, ranged, or fully custom weapon logic) do the rest, with zero code from that mod's author.
- Any mod's projectiles, automatically. Arrows, tridents, bullets, cannonballs, anything extending vanilla's
Projectile class damages sub-level blocks correctly on impact, regardless of which mod fired them.
- Mob-driven vehicles. Cars spawn as physics sub-levels with a mob at the wheel, driven through the Mob Transmitter block.
- Spawn nodes. Road structures generate in open biomes on a levelled pad and fill themselves with cars.
- Bring your own cars. Drop
.nbt vehicle files into your world's folder and they join the spawn pool for the tier you choose.
- Smart drivers. Pilots chase, wander, avoid obstacles and each other, steer clear of water and cliffs, slow down for corners, and right themselves when flipped.
- Ship-aware targeting. Sub-levels only become valid targets if they're built from real propulsion/structural parts (configurable block tag) and have a player nearby, so idle player builds and abandoned test rigs aren't at risk by default.
- Optional deep compatibility. If Create: Big Cannons is installed, its own block armor/hardness values scale how many hits a block takes to break.
- Fully configurable. Search radius, attack range, fire rate, hit thresholds, creeper griefing, Enderman theft, ship-detection strictness, vehicle tiers, driving goals, and more.
How It Works
Sub-level blocks don't live at the position you see them at. Sable stores each sub-level's real block data in an isolated plot elsewhere in the world, and only visually poses it at its current in-game location. Every interaction this mod adds (finding a nearby block, aiming a projectile, breaking through a hull) correctly transforms between that raw storage space and the sub-level's posed, visual position, so mobs and projectiles hit exactly where they appear to be aiming.
Damage is tracked per block via a shared hit-counter, driving Minecraft's own crack-progress overlay before the block actually breaks, so combat against a ship looks and feels like combat against any other structure.
Mob-Driven Vehicles
Vehicles are ordinary structure templates of a Sable sub-level. When one is needed, the mod places the template in the world, triggers the physics assembler inside it, finds the Create seat, and seats a pilot there. The pilot drives through a Mob Transmitter, which turns the mob's decisions into steering and throttle on the vehicle.
- Cars calibrate their own steering and throttle direction, so most builds drive correctly without setup.
- Each tier has its own
max_speed.
- Pilots respawn if you leave the area or reload the world, and a car whose pilot is killed is left behind as a wreck.
- Cars that never manage to assemble are turned into wrecks instead of leaving loose blocks around.
Spawn Nodes
Each tier has a node: a road structure that generates in the world and spawns cars around itself when a player gets near.
- Nodes sit on a levelled pad with a naturally tapered edge, so they stay clear of trees and hills.
- The pad matches its surroundings: sandstone and sand in deserts, packed mud, red sand and terracotta in badlands, snow in snowy biomes, gravel and stone on stony shores, and dirt and grass everywhere else.
- Nodes only generate in open biomes (plains, desert, savanna, badlands and similar). The list is a biome tag you can edit:
sablemobinteractions:vehicle_node_biomes.
- Nodes follow each tier's ring (
min_radius and max_radius) measured from the world origin, and are skipped on steep terrain and near water.
- Cars are placed only on flat, clear ground, never inside trees or each other.
/place structure works for nodes and ignores the biome, ring, flatness and sea level checks, so you can place one anywhere for testing.
Nodes only appear in newly generated chunks, so existing worlds will see them as you explore.
Custom Cars
Put your own .nbt car files in saves/<world>/vehicles/<tier>, for example saves/<world>/vehicles/tier_1_scrap. They join that tier's pool and are rescanned as files change.
- The built-in car is copied into the tier 1 folder the first time it is needed. Delete it from that folder if you don't want it in your pool.
- If a tier's folder is empty, the built-in car is installed again so the tier always has something to spawn.
- Cars need a Create seat for the pilot and a physics assembler block inside the structure.
- Redstone link frequencies are randomised for each spawned car, so two copies of a car never interfere with each other.
- Custom cars are not copied between worlds automatically.
Vehicle Tiers
Tiers are JSON files in data/sablemobinteractions/vehicle_tiers/, one per tier (tier_1_scrap through tier_5_boss are included). A tier controls:
- The ring it spawns in (
min_radius, max_radius) and how rare its sites are
- How many cars appear per site and how far apart they must be
- Top speed
- Which mobs pilot the cars
- Which driving goals the pilots use, in priority order
The structures list is for datapack-provided cars. Leave it as [] to use only the cars in the world's vehicles folder.
Driving Goals
Goals run in the order listed in the tier JSON. The first goal that wants control steers the car.
| Goal |
What it does |
chase |
Drives at a target player, circling and backing away when too close |
wander |
Drives around aimlessly when there is nothing to chase |
avoid |
Steers around obstacles and other vehicles |
avoid_water |
Steers away from deep water and lava |
avoid_cliffs |
Steers away from large drops |
slow_turn |
Slows down before sharp turns so cars are less likely to flip |
stay_upright |
Reduces speed when tilted, and rights a car that has flipped over and stopped |
unstick |
Reverses out of jams |
If you have your own tier JSON files from an older version, add avoid_water, avoid_cliffs, slow_turn and stay_upright before unstick.
Commands
/sablemobinteractions vehicles lists tracked vehicles, their state and their pilots
/sablemobinteractions customcars lists the custom cars found for each tier
/sablemobinteractions clearvehicles removes every car spawned by the mod, never vehicles built by players (needs SableCat)
/sablemobinteractions debugdrive <true|false> prints what each pilot is thinking
Configuration
Accessible in-game via Mods → Sable Mob Interactions → Config, or by editing sablemobinteractions-common.toml directly. Includes:
- Per-mob search radius, attack range, and fire cooldown
- Base hits required to break a block, with optional hardness scaling
- Player-presence range required before a sub-level becomes targetable
- Toggle to require ship-essential blocks before a sub-level is targetable at all
- Toggle for creeper griefing and Enderman theft independently
- Mod namespaces and block tags for extending what counts as stealable or ship-essential
Vehicle behaviour is configured per tier in the tier JSON files, and node biomes in the biome tag.
Building Against This Mod
Want your own mob to have tighter, purpose-built control over how it attacks sub-levels, rather than relying on the generic fallback? Implement SubLevelAttacker on your mob's entity class:
public interface SubLevelAttacker {
void attackSubLevelBlock(Vec3 targetWorldPos, SubLevel subLevel, BlockPos localPos);
default double getSubLevelAttackRange() { return 15.0; }
default int getSubLevelAttackCooldownTicks() { return 40; }
}
Any mob implementing this interface is picked up automatically, no registration needed on your end.
Requires
- Sable (required)
- SableCat 1.0.3 or newer (required, it provides the lag fix and vehicle cleanup this mod depends on)
- Create (required, cars use Create seats)
- Simulated (required, the physics assembler that turns spawned cars into sub-levels)
- Create Connected (required, the built-in car uses its gearbox)
- Offroad (required, the built-in car uses its tires)
Everything else is optional. Create Aeronautics, Create Submarine, and Create: Big Cannons are only used to enhance specific behaviors when present, and the mod works fully without them.
评论 0
登录后参与评分
还没有评论,来抢沙发吧