Vehicles Configuration

Each YAML file (.yml) located within the "vehicle" folder is meticulously interpreted by the plugin as a unique vehicle type.

Entries

  • id: Vehicle type unique identifier.

  • name: Vehicle type name.

  • health:

    • max-health: The maximum vehicle's health (100 by default).

  • exit-shortcut:

    • operator: Exit-shortcut for the player in the main seat.

    • passenger (optional): Exit-shortcut for the passengers. If not set, the operator shortcut will be used instead.

  • model: The id of the model to use for this vehicle.

  • pickup-item (optional): The id of the item to give when the vehicle is picked up by the owner. Do not set if you don't want players to be able to pickup the type of vehicle you are configuring. Please make sure that the action of the item is "spawn", and that the vehicle it spawns matches with the type of vehicle you are configuring.

  • physics:

    • floats: If enabled, the vehicle will not sink when moving over liquid surfaces. Must be enabled when creating watercraft-like (boats, rafts, etc..) vehicles.

    • gravity:

      • maximum: The maximum gravity force. In other words, the maximum pull-down force of the gravity.

      • acceleration: The force of gravity increases with each tick by this value.

    • friction:

      • air: The friction of the air. The greatest this value, the faster the momentum of the vehicle (in the y-axis) will decrease each tick.

      • on-unknown: The friction of unknown surfaces. The higher this value, the faster the vehicle's momentum (in the x and z axes) will decrease at each tick when moving over solid surfaces.

      • on-solid: The friction of solid surfaces. The higher this value, the faster the vehicle's momentum (in the x and z axes) will decrease at each tick when moving over solid surfaces.

      • on-dusty: The friction of dusty surfaces. The higher this value, the faster the vehicle's momentum (in the x and z axes) will decrease at each tick when moving over dusty surfaces.

      • on-snowy: The friction of snow-covered surfaces. The higher this value, the faster the vehicle's momentum (in the x and z axes) will decrease at each tick when moving over snow-covered surfaces.

      • on-slippery: The friction of slippery surfaces. The higher this value, the faster the vehicle's momentum (in the x and z axes) will decrease at each tick when moving over slippery surfaces.

      • on-water: The friction of water. The higher this value, the faster the vehicle's momentum (in the x and z axes) will decrease at each tick when moving over water.

      • on-lava: The friction of lava. The higher this value, the faster the vehicle's momentum (in the x and z axes) will decrease at each tick when moving over lava.

      • through-water: The friction through water. The higher this value, the faster the vehicle's momentum (in the x and z axes) will decrease at each tick when moving through the water.

      • through-lava: The friction through lava. The higher this value, the faster the vehicle's momentum (in the x and z axes) will decrease at each tick when moving through the lava.

    • climbing:

      • block-climb-capacity: This option determines how high a vehicle can climb. Higher values allow the vehicle to climb steeper inclines and obstacles. For example, a car with a climbing ability of 1 might struggle to climb hills, while a monster truck with a climbing ability of 3 can easily scale mountains. Setting it to 0 will disable climbing entirely for that vehicle.

  • fuel:

    • capacity: The fuel capacity for this type of vehicle.

    • min-consumption: The least amount of fuel a vehicle uses when operating at its minimum capacity.

    • max-consumption: The maximum amount of fuel a vehicle uses when operating at its maximum capacity.

  • controllers: Each section here represents a controller. Controllers determine the behavior of the vehicle. Controllers cannot be created from a configuration file; they are created from code; although you can change their configuration/properties from here. You can find more information below.


Damage

From this section you will be able to customize the way your vehicle receives damage.

Modifiers

Modifiers are used to "modify" specific types of damage; as simple as that. Modifiers can either reduce or amplify certain types of damage. So, you can simply think of a modifier that reduces the damage as a "damage-reducer," and a modifier that amplifies the damage as a "damage-amplifier".

Here is a real-life example of what a modifier can be used for: Let's say you want to create a tank. Tanks are heavy armored, so they are resistant to explosions; so, obviously, you will want to reduce the damage the tank receives from explosions.

To do that you simply create a modifier that reduces damage from explosions by setting the type of damage to "explosion".

To add a modifier, create a section within the modifiers section, then specify the type of damage to modify, and the value. It should look something like this:

modifiers:
  my-example-explosion-damage-modifier:
    type: explosion
    value: -65.0

This example modifier will reduce the damage from explosions by 65% percent, as the type is set to "explosion" and the value is set to -65.0, which is obviously a negative value. If instead of reducing the damage, you wanted to amplify it, you would just specify a positive value (i.e 65.0).

Now, here is a list with all the types of damage you can modify:

  • in_fire

  • lightning_bolt

  • on_fire

  • lava

  • hot_floor

  • in_wall

  • cramming

  • drown

  • starve

  • cactus

  • fall

  • fly_into_wall

  • out_of_world

  • generic

  • magic

  • wither

  • dragon_breath

  • dry_out

  • sweet_berry_bush

  • freeze

  • stalagmite

  • falling_block

  • falling_anvil

  • falling_stalactite

  • sting

  • mob_attack

  • mob_attack_no_aggro

  • player_attack

  • arrow

  • trident

  • mob_projectile

  • fireworks

  • fireball

  • unattributed_fireball

  • wither_skull

  • thrown

  • indirect_magic

  • thorns

  • explosion

  • player_explosion

  • sonic_boom

  • bad_respawn_point

  • generic_kill


Controllers

Understanding Controllers:

How Controllers Shape Vehicle Behavior:

  • The "controllers" section of the configuration file is where you define the controllers that will determine the behavior of each vehicle type.

  • Think of controllers as the brains behind the vehicle's actions; as they determine how it accelerates, steers, brakes, and more.

  • While you don't "create" controllers from scratch, you select and customize pre-coded ones to define the vehicle's behavior.

Customizing Controller Properties:

  • Within the "controllers" section, each subsection represents a specific controller.

  • You have the flexibility to adjust the properties of each controller to fine-tune its behavior.

  • For example, you might tweak a controller's turning angle to make steering more agressive or adjust its minimum and maximum acceleration for a faster driving.

Key Points:

  • Plugin Interpretation: The plugin reads each subsection within the "controllers" section as a distinct controller.

  • Customizing Behavior: By selecting and customizing controllers, you shape how each vehicle type handles and responds to player input.

  • No Controller Creation: Remember that you don't create new controllers from scratch; you work with the existing ones provided by the plugin, or third-party entities.

To add a controller, create a section within the controllers section, and in the "id" entry, specify the id of the type of controller to use, these are the predefined types:

  • fixed-wing-vehicle: For airplane-like vehicles.

  • ground-vehicle: For vehicles that operate on land (e.g cars, trucks, bikes, etc...).

  • hybrid-vehicle: For vehicles that operate on both land and water.

  • rotorcraft-vehicle: For rotorcraft-like vehicles (e.g helicopters).

  • watercraft-vehicle: For watercraft-like vehicles (e.g boats).

Once you've created the section for your controller and specified the id, it should look something like this:

controllers:
  my-example-watercraft-controller:
    id: watercraft-vehicle
    .
    ..
    ... controller properties here

The entries for the properties of the controller will depend on the type of controller you choose. You can find all the properties you can customize on each controller type here: Predefined controller properties. Now, when it comes to controllers coded by third-party entities; Beside the controller .jar file, they should also provide the properties available for customization. To code your custom controller, please go to: CONTROLLER API STUFF LINK HERE

Predefined controller properties

fixed-wing-vehicle

  • take-off-from-land-only

  • take-off-speed

  • stall-speed

  • increase-height-min-speed

  • increase-height-max-speed

  • decrease-height-min-speed

  • decrease-height-max-speed

  • max-flying-positive-acceleration

  • max-land-positive-acceleration

  • max-negative-acceleration

  • positive-acceleration-flying

  • positive-acceleration-on-solid

  • positive-acceleration-on-dusty

  • positive-acceleration-on-slippery

  • positive-acceleration-on-water

  • positive-acceleration-on-lava

  • negative-acceleration-flying

  • negative-acceleration-on-solid

  • negative-acceleration-on-dusty

  • negative-acceleration-on-snowy

  • negative-acceleration-on-slippery

  • negative-acceleration-on-water

  • negative-acceleration-on-lava

ground-vehicle

  • max-positive-acceleration

  • max-negative-acceleration

  • positive-acceleration-on-solid

  • positive-acceleration-on-dusty

  • positive-acceleration-on-snowy

  • positive-acceleration-on-slippery

  • negative-acceleration-on-solid

  • negative-acceleration-on-dusty

  • negative-acceleration-on-snowy

  • negative-acceleration-on-slippery

  • deceleration

  • turning-angle-min

  • turning-angle-max

  • min-fuel-consumption: Overrides the vehicle's minimum fuel consumption.

  • max-fuel-consumption: Overrides the vehicle's maximum fuel consumption.

hybrid-vehicle

  • max-positive-acceleration

  • max-negative-acceleration

  • positive-acceleration-on-solid

  • positive-acceleration-on-dusty

  • positive-acceleration-on-snowy

  • positive-acceleration-on-slippery

  • positive-acceleration-on-water

  • positive-acceleration-on-lava

  • negative-acceleration-on-solid

  • negative-acceleration-on-dusty

  • negative-acceleration-on-snowy

  • negative-acceleration-on-slippery

  • negative-acceleration-on-water

  • negative-acceleration-on-lava

  • deceleration

  • turning-angle-min

  • turning-angle-max

  • min-fuel-consumption: Overrides the vehicle's minimum fuel consumption.

  • max-fuel-consumption: Overrides the vehicle's maximum fuel consumption.

rotorcraft-vehicle

  • max-positive-acceleration

  • max-negative-acceleration

  • positive-acceleration

  • negative-acceleration

  • deceleration

  • increase-height-speed

  • decrease-height-speed

  • rotation-angle

  • min-fuel-consumption: Overrides the vehicle's minimum fuel consumption.

  • max-fuel-consumption: Overrides the vehicle's maximum fuel consumption.

watercraft-vehicle

  • max-positive-acceleration

  • max-negative-acceleration

  • positive-acceleration-on-water

  • positive-acceleration-on-lava

  • negative-acceleration-on-water

  • negative-acceleration-on-lava

  • deceleration

  • turning-angle-min

  • turning-angle-max

  • min-fuel-consumption: Overrides the vehicle's minimum fuel consumption.

  • max-fuel-consumption: Overrides the vehicle's maximum fuel consumption.

Last updated