Skip to main content
Vehicle MC wiki

Wiki

Vehicle MC Wiki

Vehicle configuration, rig backends, service systems, terrain handling, and combat-ready admin workflows.

Vehicle Authoring

Learn the top-down YAML flow so you know what belongs in config.yml, vehicles.yml, service files, and player-side UI files.

Service and World

Handle vehicle servicing, repair tools, fuel tanks, spawnpoints, and station behavior.

Vehicle Content

Vehicle Interactions, Entry, Exit, Trunks, Horns, and Pickup

Explain how entry, exit, trunk access, horns, pickup, storage safety, and permissions work together for live vehicles.

Vehicle MC has two different interaction layers:

  • per-vehicle interaction rules in vehicles.yml
  • plugin-wide pickup and storage rules in config.yml

That split matters. If a trunk, horn, or pickup flow feels wrong, you need to know which side of the system is in charge before you start changing values.

The two files that shape interaction

Use vehicles.yml for behavior that belongs to one vehicle family:

  • how close players must be to enter
  • whether clicking any part can mount the vehicle
  • trunk click behavior
  • vehicle-level pickup allowances
  • horn availability

Use config.yml for the global storage contract:

  • whether pickup is enabled across the server
  • whether stored vehicles preserve fuel, health, and trunk contents
  • anti-dupe rules
  • whether pickup is blocked during combat

Entry flow

The shared interaction defaults in vehicles.yml already expose a clean entry layer:

YAML
interaction:
  enter:
    maxDistance: 3.0
    clickAnyPart: true
    chooseSeat:
      mode: NEAREST_TO_HIT
      maxSeatDistance: 2.2

What these settings change in practice:

  • maxDistance decides how close the player must be before the vehicle feels usable
  • clickAnyPart makes large or complex rigs much easier to mount
  • chooseSeat.mode: NEAREST_TO_HIT helps players land in the seat that matches the part they clicked instead of always falling into the same seat
  • maxSeatDistance keeps seat selection from snapping to a seat that feels too far away from the clicked area

For a simple dirt bike, a loose entry radius usually feels good. For a tank or helicopter with multiple seats, keeping seat choice readable matters more than making the whole rig clickable from everywhere.

Exit flow

Vehicle exit is also controlled at the interaction layer:

YAML
interaction:
  exit:
    useSneakToExit: true
    useSteerVehicleUnmount: true

This is the usual live-server expectation:

  • sneak to leave the seat
  • let normal vehicle unmount input work where supported

If players are leaving vehicles by accident, tighten the exit path before changing seat offsets. If players feel trapped inside the vehicle, the exit rule is usually the first place to check.

Seat changing is a separate system. If you want passengers to move between seats only while the vehicle is almost stopped, handle that in runtime Modules, Physics, and Safety.

Trunks are both storage and part of the pickup flow

Vehicle trunks live in two branches at once:

  • stats.trunk.* decides whether a vehicle has usable storage
  • interaction.trunk.* decides how players open it

Example:

YAML
stats:
  trunk:
    enabled: true
    rows: 3
    usableSlots: 21
 
interaction:
  trunk:
    openMethod: LEFT_CLICK
    requireSneak: true

How to read this:

  • rows controls total inventory height
  • usableSlots lets you leave part of the menu reserved or decorative
  • openMethod defines the player action
  • requireSneak keeps the trunk from fighting entry clicks

The current source defaults also reserve the last slot for the pickup button when that pickup mode is active. That makes trunk design part of the storage contract, not just a cosmetic menu choice.

Good public pattern:

  • small scout vehicle: one row, very few usable slots
  • transport vehicle: two or three rows, clear storage role
  • combat platform: trunk only if it makes gameplay sense

Horns are simple, but they still need policy

Horn config is small and should stay small:

YAML
stats:
  horn:
    enabled: true
    cooldownSeconds: 5
    sound: vehicles.horn

This is enough to decide:

  • whether the vehicle has an audible identity
  • how spam-proof the horn is
  • which sound lane fits the family

If every vehicle can honk constantly, the feature becomes noise instead of feedback. Cooldown is what keeps horns readable on busy servers.

Vehicle-level pickup vs global pickup

Vehicle-level pickup rules live in vehicles.yml:

YAML
interaction:
  pickup:
    enabled: true
    method: SNEAK_RIGHT_CLICK
    requireEmptyHand: false
    drop:
      mode: SPAWN_ITEM

Global pickup rules live in config.yml:

YAML
pickup:
  enabled: true
  method: TRUNK_BUTTON
  maxSpeed: 0.10
  requireEmptyVehicle: true
  allowPickupInCombat: false
  preserveTrunkContents: true
  preserveHealth: true
  preserveFuel: true

The important public rule:

  • the vehicle can allow pickup
  • the global config still decides whether pickup is truly available and how safe it is

That means a vehicle-level pickup switch is not the whole story. Public storage behavior is really the combination of both files.

Storage safety and anti-duplication

Pickup only feels trustworthy when the stored vehicle comes back with the right state.

These global safety settings matter as much as the interaction button:

YAML
pickup:
  storage:
    mode: SQLITE
    preventDupes: true
 
safety:
  antiDupe:
    enabled: true
    spawnRequiresPersistedRecord: true
    preventDoubleSpawnSameUuid: true

What this means to players and admins:

  • a stored vehicle should come back as the same vehicle, not a partial copy
  • stored fuel and health should survive if you chose to preserve them
  • the same vehicle should not be able to exist twice because of lag, repeated clicks, or bad recovery flow

If your server expects players to treat vehicles as persistent assets, these settings are part of the feature, not an optional extra.

Permissions and public expectations

The plugin-wide permission defaults live in config.yml:

YAML
permissions:
  enforce: true
  defaults:
    ride: vehiclemc.ride.*
    drive: vehiclemc.drive.*

This matters because interaction is not only about clicking the right spot. It is also about whether the player is allowed to:

  • mount the vehicle
  • drive it
  • store it
  • use it during combat

If interaction looks broken for only some players, check permissions before rewriting the vehicle family.

Scout or civilian vehicle

  • easy entry
  • small trunk
  • horn enabled
  • pickup allowed only while stopped

Heavy combat vehicle

  • readable seat layout
  • strict exit and seat-switch behavior
  • larger trunk only if it supports the role
  • pickup usually disabled or heavily restricted

Service or logistics vehicle

  • generous trunk
  • simple entry
  • horn optional
  • preserved storage and fuel matter more than raw speed