Setting Up Fuel - korbynullevig/craftmoto GitHub Wiki

Fuel system is a way to make your vehicles more realistic or making some restrictions. If vehicle is totally empty, he will stop and effect and sound will be disabled. Doesn't affect Hurt effect.

  • <int> Is a number, as 1, 10, 6487 . Don't put negative value if it isn't writed. X.0 isn't a int.
  • <double> Is a decimal number, as 0.7 or 0.0 . Don't put negative value if it isn't writed. Int can be used too.
  • <char> Is only one character, but it can be a number, letter or UTF-8 character.
  • <string> some characters. On this config size, you may NOT use UTF-8 character.

Example from Template.yml .

fuel:
  item: ## The item to use as fuel. Leave empty or delete to not use fuel.
    ==: org.bukkit.inventory.ItemStack
    type: COAL
  burn_time: 1200 ## Burn time in ticks.
  show_status:
    enabled: false ## Whether or not to periodically show the fuel level in the action bar.
    period: 200 ## If enabled, show fuel level every X ticks (20 ticks per second).
    character: ':' ## The character to use as the fuel indicator.
  solar_panels:
    enabled: false ## Whether or not to use solar panels.
    rate: 0.05 ## How fast fuel is restored (in percent per tick).
    light: 8 ## The light level required, from 0 (full darkness) to 15 (full brightness).
  gas_station:
    rate: 0.5 ## How fast fuel is restored (in percent per tick).
    offset: -0.8 ## The y-offset to search for the gas station block.
    block: ## The block that works as a gas station. If this block is found at any seat's location (plus the offset, above), refuelling will begin.
      ==: org.bukkit.inventory.ItemStack
      type: COAL_BLOCK

You can make it for each vehicle, that's apply only to the Helmet.

First, take your helmet file, and verify if your vehicle has an inventory on at least one seat. If your helmet does'nt have any seat with inventory module on spadebar / control / wasd, fuel will be ignored.

SET UP THE ITEM FUEL

  item:
    ==: org.bukkit.inventory.ItemStack
    type: <string>
  burn_time: <int>
  • type: <string> must be any minecraft item, tool, weapon, block...
  • Right-clic with the fuel item on a vehicle will full load the actual load.
  • You can put it in the vehicle inventory, as a tank, it will be consumed each time the vehicle fuel level is empty. It doesn't consume other item.
  • burn_time: int is the time in ticks (20 ticks x sec) for one load. So, 1200 ticks = 1 minute.

SET UP THE SHOW STATUS (Optional)

  show_status:
    enabled: <true/false>
    period: <int>
    character: '<char>'
  • enabled: <true/false> is just if you want to permise the driver and all passengers to see the fuel level of actual load.
  • period: <int>is the delay (in ticks) between two show of the fuel level.
  • character: '<char>is the character which will showed as a bar. Only one character can be used, like | * or ╣...

SET UP THE SOLAR PANEL (Optional)

solar_panels:
    enabled: false
    rate: <double>
    light: <int into 0 and 15>
  • enabled: <true/false> Whether or not to use solar panels.
  • rate: <double> How fast fuel is restored (in percent per tick, 20 ticks = 1 second)
  • light: <int into 0 and 15> The minium light level required. 0 is Darkness, 15 is full light. The light is the one of the vehicle center block.

SET UP THE GAS STATION (optional)

  gas_station:
    rate: <double>
    offset: <double>
    block:
      ==: org.bukkit.inventory.ItemStack
      type: <string>
  • rate: <double> means the percent of fuel level restored in one tick. (1 second = 20 ticks).
  • offset: <double> The vertical offset to search the gas station block in blocks. Can be negative.
  • type: <string> Whitch bloc can be used as gas station.

YOU HAVE DONE WITH THE FUEL SYSTEM !

⚠️ **GitHub.com Fallback** ⚠️