▶️ ЗАБЕРИ СВОИ 8 ПОДАРКОВ 🎁 ПРИ СОЗДАНИИ СВОЕГО МАЙНКРАФТ СЕРВЕРА
Моды/CC: Optical
CC: Optical

CC: Optical

All you need for your turrets!

Оцените первым
1.2K
5

CC:Optical

Adds sensor and cannon control peripherals to CC:Tweaked, compatible with Create:Aeronautics.

!All blocks

Sensors

Three variants, one method — scan():

Optical Sensor (optical_sensor) — detects entities up to 96 blocks. Requires direct line of sight (real terrain blocks only; sublevel terrain is transparent).

Directional Optical Sensor (directional_optical_sensor) — same but with a cone-shaped field of view (configurable, default 110°), range 80 blocks.

Radar (entity_radar) — omni-directional, range 64 blocks, ignores line of sight. Position readings have Gaussian noise (increases with distance, varies by sensor altitude relative to sea level).

Detections work across sublevel boundaries. A sensor on an airship can spot another airship and the entities inside it. Each detection carries the sublevel UUID when the target is inside one.

Detection fidelity decreases with range. Optical sensors report exact entity types up to 56 blocks and player names up to 40 blocks. Radar does the same within 28 and 18 blocks — beyond that, targets are classified only by size (object_small/object_mid/object_large). Radar position noise grows linearly with distance and varies with the sensor's altitude relative to sea level.

Lua API

All three expose the same single method:

MethodParametersReturnsDescription
scanrelativeCoords: boolean (optional)tableRun an immediate scan. If true, returned positions are rotated into the sensor's sublevel local frame.

scan() return table

FieldTypeDescription
countnumberNumber of detections
lastScanTicknumberServer tick when scan ran
detectionstable[]Array of detection objects

Detection fields

FieldTypeDescription
idstringEntity UUID (or sublevel UUID for sublevel bounding boxes)
typestringEntity registry name (e.g. "minecraft:zombie"), size class ("object_small"/"object_mid"/"object_large"), or "sublevel"
namestring or nilPlayer scoreboard name (if within name-precision distance)
x, y, znumberOffset from sensor origin (blocks)
distancenumberStraight-line distance
subLevelUUIDstring or nilUUID of the sublevel the entity is inside
subLevelNamestring or nilName of the sublevel

Example

local sensor = peripheral.wrap("left")

while true do
  local res = sensor.scan()
  print("Targets: " .. res.count)
  for _, t in ipairs(res.detections) do
    print(("%s @ %.1f m"):format(t.type, t.distance))
  end
  sleep(0.25)
end

CBC Cannon Mount

Wraps cannon mounts from Create Big Cannons as cbc_cannon_mount peripherals (additional type cannon_mount). Aim, fire, and query state from Lua.

MethodParametersReturnsDescription
assemblebooleanAssembles the cannon contraption
disassemblebooleanDisassembles
firebooleanFires the cannon
isRunningbooleanWhether assembled and running
isAssembledbooleanSame as isRunning
isLoadedbooleanWhether cannon can fire
setPitchpitch: numberbooleanSet target pitch (degrees)
setYawyaw: numberbooleanSet target yaw (degrees)
getPitchnumberCurrent pitch
getYawnumberCurrent yaw offset
getXnumber or nilController X position
getYnumber or nilController Y position
getZnumber or nilController Z position
getMaxDepressnumber or nilMaximum depression angle
getMaxElevatenumber or nilMaximum elevation angle
getDirectionstring or nilFacing direction (north/south/east/west)
getCannonWeightnumber or nilCannon stress-weight

Rotation can be restricted by config (cbcFreeRotationEnabled, cbcFreeRotationMaxWeight). Throws LuaException when blocked.

Fully compatible with CannonMountPeripheral from VS: Addition - same "cannon_mount" additional type, same method shapes.

For Server Owners

All features are configurable. Disable the CBC cannon mount peripheral (cbcPeripheralEnabled: false) to avoid conflicts with other mods that add the same peripheral (CC:CBC as example).

Часто задаваемые вопросы

Совместимость

Minecraft: Java Edition

1.21.x

Платформы

Поддерживаемые окружения

Клиент и сервер

Зависимости

Детали

Лицензия:
Опубликован:2 месяца назад
Обновлён:2 месяца назад
Главная