Configuration

The Configuration File

The config.yml is located in your /plugins/vHunger directory. You can edit the settings to your pleasure to change the properties of vHunger. This page is up to date, and is applicable for vHunger v1.2.4.

It is recommended you use a text editor like Notepad+ + (Windows) or TextWrangler (Mac). YAML will hate you if you use tabs. You must be consistent with your spacing.

Throughout this file, we will use abbreviations:
[true|false] means you need a boolean value (true or false)
[integer] means you need an integer (no doubles)
[double] means you need a number with at most 2 decimal points (1.0, 2.5, 0.88, etc.. 1, 2, 10 will not work.)

Let's get started.

The default file

The following is what the default config.yml will look like when you first install v1.2.2.84 and delete your old config file, if you are updating:

global-settings:
  enabled: true
  check-for-updates: true
  auto-update: false
  hunger: true
worlds:
- world
- world_nether
effects:
  poison:
    duration: 7
    amplifier: 2
    hunger-at-activation: 16
    message: '&eYou are sick from your starvation... You should really consider eating.'
depletion-rate:
  sprinting: 1.7
  sneaking: 0.77
  swimming: 1.6
  flying: 1.0
  sleeping: 0.3

Global Settings

The global-settings configuration section allows you to change settings across all worlds.

global-settings:
   # You can enable or disable the whole plugin.
  enabled: [true|false]

  # You can disable hunger. However, potion effects could still be triggered in special scenarios.
  hunger: [true|false]

  # Do you want to be notified about updates to this plugin? Players with op or hunger.update (hunger.admin) will receive a message upon login.
  check-for-updates [true|false]
  # If check-for-updates is true and auto-update is true, the plugin will automatically download new files as I release them.
  auto-update: [true|false]

Setting up Worlds

There is a limited per-world support feature for vHunger v1.2.2.84 (It will be expanded). For now, you can configure the worlds in which potion effects and hunger scaling will take place.

Example:

# This is a string list. Note, the '-' is aligned with the 'w' in worlds. This isn't all-important, but it's good to make sure you are following proper formatting. You can add which ever worlds you please, but remember, it is case-sensitive! world is not the same as WoRlD
worlds:
- world 
- world_nether

Configuring Potion Effects

This is the 'bread and butter' of the plugin and why it exists today. Previously, you could only have a few potion effects, but now all are accounted for.

You can view a list of potion-effects here.

effects:
  # The name is not case-sensitive. You can use any case, and instead of spaces you must use either underscores (_) or hyphens (-).
  increase-damage:
    # The duration of the effect in seconds. If left empty, it defaults to 5.
    duration: [integer > 0]

    # The amplifier of the effect.
    amplifier: [integer > 0]

    # This is the food bar at which the potion effect is triggered. This is necessary!
   hunger-at-activation: [integer between 0 and 20]

   # Message you want to send to players when they receive the effect. You may use hex color codes (&). Note: The message must be enclosed in single quotations.
   message: '&eYou da man!'

Customizing Hunger Depletion Rate

You can customize hunger depletion rate in a variety of ways. They only take affect in configured worlds.

# Set to 1.0 for normal depletion rate. Anything > 1 results in faster depletion, and anything < 1 results in less depletion.
depletion-rate:
  # Depletion when a player is running.
  sprinting: [double]
  
  # When a player is sleeping.
  sleeping: [double]
  
  # When a player is swimming (in water)
  swimming: [double]

  # While sleeping.
  sleeping: [double]

  # While flying.
  flying: [double]

More nodes to come!