2023-01-25 19:35:40 +00:00
---
title: Creating a VehicleModel
description: This page describes how to create a custom VehicleModel
published: true
2024-12-01 18:21:22 +00:00
date: 2023-02-16T21:10:54.035Z
2023-01-25 19:35:40 +00:00
tags:
editor: markdown
2024-12-01 18:21:22 +00:00
dateCreated: 2023-02-16T21:10:52.165Z
2023-01-25 19:35:40 +00:00
---
# Creating a VehicleModel
This page describes how to create a custom VehicleModel
## Preparing the skin
This section is still work in progress!
## Creating the model
Go to the `vehicles` folder in the VehiclesPlus data folder. Choose the vehicletype you want to create the model in. Copy the example model and rename the file to the name for your new model.
Now start changing the configuration based on your preferences. The following configuration can be used as reference:
```json
{
//The unique identifier of your model, probably the same as the filename
id: ExampleCar
//The name for this model used in the GUIs (like the shop), supports chatcolors
displayName: & cExample & aCar
//The unique identifier for the vehicletype, MUST be the same as the folder name
typeId: car
//The price of this vehicle in the shop
price: 100000
//The permissions for this vehicle
permissions:
{
//This permission is required to buy this vehicle
buy: vp.buy.ExampleCar
//This permission is required to change a bought vehicle (tuning, settings, fixing, ...)
adjust: vp.adjust.ExampleCar
//This permission is required to spawn a bought vehicle
spawn: vp.spawn.ExampleCar
//This permission is required to drive a bought vehicle
ride: vp.ride.ExampleCar
//If true, players can sit in the non-drive seats without the ride permission
sitWithoutRidePermission: true
}
2023-01-25 19:43:45 +00:00
//Contains all the RGB colors available for this model in the shop
2023-01-25 19:35:40 +00:00
availableColors:
[
{
red: 255
green: 0
blue: 0
}
{
red: 0
green: 0
blue: 0
}
{
red: 255
green: 255
blue: 255
}
{
red: 128
green: 128
blue: 128
}
{
red: 192
green: 192
blue: 192
}
]
2023-01-25 19:43:45 +00:00
//A list of all the parts for this model
2023-01-25 19:35:40 +00:00
parts:
[
//The skin part is the main chasis of the vehicle
{
type: skin
//The x, y and z offsets are the offsets from the center location of the vehicle
//X = Forwards (+) or backwards (-)
xoffset: 0
//Y = Higher (+) or lower (-)
yoffset: 0
//Z = Left (+) or right (-)
zoffset: 0
//The item containing the chasis
//Check out the section below for more information
item:
{
damage: 1
material: LEATHER_BOOTS
unbreakable: true
color:
{
red: 255
green: 255
blue: 255
}
}
}
2023-01-25 19:43:45 +00:00
//Now 4 seat parts follow
2023-01-25 19:35:40 +00:00
{
type: seat
//Check out the description at the skin part
xoffset: -0.2
yoffset: -1.45
zoffset: 0.45
//If set to true, a player in this seat can steer the vehicle
steer: true
}
{
type: seat
xoffset: -0.2
yoffset: -1.45
zoffset: -0.45
steer: false
}
{
type: seat
xoffset: -1
yoffset: -1.45
zoffset: 0.45
steer: false
}
{
type: seat
xoffset: -1
yoffset: -1.45
zoffset: -0.45
steer: false
}
2023-01-25 19:43:45 +00:00
//Now 4 wheels follow
2023-01-25 19:35:40 +00:00
{
type: wheel
//Check out the description at the skin part
xoffset: 1.8
yoffset: 0
zoffset: -1.1
//The ID of the rim design used for this model
rimDesignId: default
//The RGB color of the wheel (only applicable if connected to leather armor)
color:
{
red: 128
green: 128
blue: 128
}
2023-01-25 19:43:45 +00:00
//If true, the wheel will move left/right when the driver steers left/right
2023-01-25 19:35:40 +00:00
steering: true
2023-01-25 19:43:45 +00:00
//The offset (degrees) the wheel will rotate when steering
//180 degrees means 90 degrees left and 90 degrees right
2023-01-25 19:35:40 +00:00
rotationOffset: 180
}
{
type: wheel
xoffset: 1.8
yoffset: 0
zoffset: 1.1
rimDesignId: default
color:
{
red: 128
green: 128
blue: 128
}
steering: true
rotationOffset: 180
}
{
type: wheel
xoffset: -1.67
yoffset: 0
zoffset: -1.1
rimDesignId: default
color:
{
red: 128
green: 128
blue: 128
}
steering: false
rotationOffset: 180
}
{
type: wheel
xoffset: -1.67
yoffset: 0
zoffset: 1.1
rimDesignId: default
color:
{
red: 128
green: 128
blue: 128
}
steering: false
rotationOffset: 180
}
]
2023-01-25 19:43:45 +00:00
//The max speed of this model
//The default max speed is 100 km/h. A player pays 1000 per 5 added to that.
//The maximum max speed which can be upgraded to is 200 km/h.
2023-01-25 19:35:40 +00:00
maxSpeed:
{
//The base setting is the default after this vehicle is bought
base: 100
//The max setting is the maximum that can be upgraded to
max: 200
//The step setting is the amount each purchase will add to the current value
step: 5
//The price the player pays per step
stepCost: 1000
}
2023-01-25 19:43:45 +00:00
//The fuel tank of this model
//Check out the maxSpeed setting for more info
2023-01-25 19:35:40 +00:00
fuelTank:
{
base: 50
max: 100
step: 5
stepCost: 1000
}
2023-01-25 19:43:45 +00:00
//The turning radius of this model
//Check out the maxSpeed setting for more info
2023-01-25 19:35:40 +00:00
turningRadius:
{
base: 7
max: 15
step: 1
stepCost: 1000
}
2023-01-25 19:43:45 +00:00
//The acceleration of this model
//Check out the maxSpeed setting for more info
2023-01-25 19:35:40 +00:00
acceleration:
{
base: 50
max: 100
step: 5
stepCost: 1000
}
2023-01-25 19:43:45 +00:00
//Sizing of the hitbox of this model
2023-01-25 19:35:40 +00:00
hitbox:
{
//Length is front to back
length: 3
//Width is left to right
width: 2
//Height is bottom to top
height: 1
}
2023-01-25 19:43:45 +00:00
//The fuel to be used to refuel this vehicle
2023-01-25 19:35:40 +00:00
fuel:
{
//The type of fuel which has to be used
typeId: gasoline
//The amount of liters used by this model
//For example, when you drive 60 km/h and the max speed is 100 km/h
//-> 60 / 100 * 6 / 1000 * 20 = 0.072 liter is used per second you drive the same speed
usage: 6
}
2023-01-25 19:43:45 +00:00
//The exhaust of this model
2023-01-25 19:35:40 +00:00
exhaust:
{
//If true, the exhaust particle will be shown
enabled: true
//The particle type to show
//Check out https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Particle.html for a full list
particle: SMOKE_LARGE
//Check out the description at the skin part
zoffset: 0
xoffset: -5
yoffset: 0
}
2023-01-25 19:43:45 +00:00
//The horn for this model
2023-01-25 19:35:40 +00:00
horn:
{
//If true, the horn will be sounded when space is pressed
enabled: true
//The sound to play
//Check out https://www.digminecraft.com/lists/sound_list_pc.php for a full list
sound: block.note_block.bass
}
2023-01-25 19:43:45 +00:00
//The sounds used for this model
//Check out https://www.digminecraft.com/lists/sound_list_pc.php for a full list
2023-01-25 19:35:40 +00:00
sounds:
{
//This sound is played when the vehicle stands still
idle:
{
//The sound to play
sound: car.idle
//The number of seconds after which the sound is replayed
duration: 6
}
//This sound is played when the vehicle is started (player enters a driver seat)
start:
{
2023-01-25 19:43:45 +00:00
//Check out the description for the idle sound
2023-01-25 19:35:40 +00:00
sound: car.start
duration: 2
}
2023-01-25 19:43:45 +00:00
//This sound is played when the vehicle accelerates
2023-01-25 19:35:40 +00:00
accelerate:
{
//Check out the description for the idle sound
sound: car.accelerate
duration: 2
}
2023-01-25 19:43:45 +00:00
//This sound is played when the vehicle is driven
2023-01-25 19:35:40 +00:00
driving:
{
//Check out the description for the idle sound
sound: car.driving
duration: 2
}
2023-01-25 19:43:45 +00:00
//This sound is played when the vehicle is slowing down
2023-01-25 19:35:40 +00:00
slowingDown:
{
//Check out the description for the idle sound
sound: car.slowingdown
duration: 2
}
}
2023-01-25 19:43:45 +00:00
//If true, steering will feel more realistic (no instant movement)
2023-01-25 19:35:40 +00:00
realisticSteering: false
2023-01-25 19:43:45 +00:00
//The size of the trunk (blocks)
2023-01-25 19:35:40 +00:00
trunkSize: 27
2023-01-25 19:43:45 +00:00
//If true, the vehicle will drift when space is pressed
2023-01-25 19:35:40 +00:00
drift: true
2023-01-25 19:43:45 +00:00
//If true, players can exit while the vehicle is moving
2023-01-25 19:35:40 +00:00
exitWhileMoving: true
2023-01-25 19:43:45 +00:00
//The health this vehicle has
2023-01-25 19:35:40 +00:00
health: 100
}
```
## Connecting your skin
The skin part has an item section. The following options are available for this section:
```json
item:
{
//The material of this item
//For a full list, see https://hub.spigotmc.org/javadocs/spigot/org/bukkit/Material.html
material: LEATHER_BOOTS
//The damage to apply to the item
2023-01-25 19:43:45 +00:00
damage: 1
2023-01-25 19:35:40 +00:00
//If true, the item will be unbreakable
2023-01-25 19:43:45 +00:00
unbreakable: true
2023-01-25 19:35:40 +00:00
//The custom model data to apply to the item
custommodeldata: 1
//The player for the skull (only applicable if the material is PLAYER_HEAD)
skull: SBDeveloper
//The RGB colors to apply to the item (only applicable for leather armor)
2023-01-25 19:43:45 +00:00
color:
{
red: 255
green: 255
blue: 255
}
2023-01-25 19:35:40 +00:00
}
```