Skip to content

Basic Configurations (config.yml)

Alex_qp edited this page Sep 27, 2023 · 8 revisions

Basic Configurations

All basic configurations are within the config.yml file located in the plugin's folder. Most of the configurations should be already commented within the file itself. The default config.yml can be found at the bottom of this page. The following will provide a more detailed description of some of the configurations. Please refer to the table of contents for a quicker overview of this page.

phantom_spawn.spawning_conditions.spawn_chance_multiplier

The chance of a phantom spawning in vanilla Minecraft is given by: vanilla-chance = (x - 3) / x, where x is the time since no rest in days (i.e. days * 24000 ticks). Note that this is a function in x: For x < 3 the vanilla-chance will be negative and the function converges to 1 for increasing x (time since no rest). After calculating the vanilla-chance Minecraft will compare it to a random number between 0 and 1. If this random number is less than or equal to vanilla-chance, phantoms will spawn. Hence, there will be no spawns before the 3 day mark in the formula and spawn chance increases for increasing time since no rest.

With the spawn_chance_multiplier configured you simply multiply the vanilla-chance with the given value. This controls the slope of the function: A higher multiplier than 1 will result in a steeper curve and therefore in a faster increasing spawn chance. Conversely, a lower multiplier than 1 will result in a flatter curve and therefore in a slower increasing spawn chance. However, the root of the function does not change so there will be no spawns before the 3 day mark regardless of the multiplier. It may help if you visualize the vanilla-chance function with the help of one of the many plotting websites.

Note that the 3 day mark in the function will actually be modified by the option phantom_spawn.spawning_conditions.player.score.min_score within the config.yml. Please remember that the value of this option is measured in ticks, so 3 days corresponds to 3 * 24000 = 72000 ticks (which is the default value)

phantom_spawn.spawning_conditions.player.score.min_score

If a player has a lower time since rest than the set value, no phantoms will spawn. Remember that this value is measured in ticks, not Minecraft days! One Minecraft day corresponds to 24000 ticks. The actual time since no rest will be reset if the player enters a bed, dies or changes to one of the enabled gamemodes in phantom_spawn.spawning_conditions.player.score.reset_gamemodes.

Please see phantom_spawn.spawning_conditions.spawn_chance_multiplier for more information about the formula behind the spawning algorithm.

Default config.yml file

# PhantomSpawnControl by Alex_qp
# This plugin provides the ability to control phantom spawning.
# Please leave a review after a while to help me improve my plugins!

phantom_spawn:
  # If set to true phantoms are able to spawn.
  enable: true

  # If set to true phantoms will get different stats (size, health, speed, etc.) based on giantPhantomsConfiguration.yml and the score of the target player.
  giant_phantoms: true

  # Configure in which worlds phantoms are able to spawn.
  world_configuration:
    # Phantoms will be able to spawn in all worlds with enabled environments unless the specific world is disabled down below.
    enabled_environments:
      normal: true
      nether: false
      the_end: false
    # No phantom will ever spawn in the listed worlds regardless of any other conditions.
    disabled_worlds:
    # - ...

  # Several other spawning conditions.
  spawning_conditions:
    # If set to true a phantom will never spawn within a block.
    check_air_spawnpoint: true
    # Until what light level should phantoms be able to spawn?
    max_light_level: 7
    # Phantoms may spawn in packs. What should be the maximal amount of phantoms in one pack?
    max_group_size: 4
    # This will multiply the spawn chance of the vanilla MC formula in order to in- or decrease spawning.
    # For more information, please see the wiki: https://github.com/Alex39099/PhantomSpawnControl/wiki/Basic-Configurations-%28config.yml%29
    spawn_chance_multiplier: 1.0

    # For each world a timer will check each player for phantom spawning. How long should it be delayed before the next attempt?
    spawn_attempts:
      min_delay: 1200
      max_delay: 2400

    # Spawning conditions regarding the whole world.
    world:
      # Does it has to be night-time in order to spawn phantoms? This will only affect normal worlds (because there is no "day" in nether, the_end)
      must_be_night: true
      # No phantom will spawn during disabled moon phases. Please add the corresponding integer of the moon phase (i.e. 1 to disable full moon). For a list of all moon phases visit the minecraft wiki: https://minecraft.fandom.com/wiki/Moon
      disabled_moon_phases:
      #  - 1
      #  - ...
      # No phantom within the protection radius of spawn will be able to spawn.
      spawn_protection_radius: 0

    # Spawning conditions regarding the target player.
    player:
      # Does the player have to be above sea level?
      above_sea_level: true
      # For what radius should a player's spawning point (i. e. his bed) protect him from phantom spawning?
      bed_protection_radius: 100.0
      # If a player is in one of the enabled gamemodes no phantom will spawn.
      spawnblocking_gamemodes:
        adventure: false
        creative: true
        spectator: true
        survival: false

      # Options regarding the score (time since rest).
      score:
        # Until what score should no phantom be able to spawn? Score increases every tick but resets by vanilla if the player enters a bed or dies.
        # For more information, please see the wiki: https://github.com/Alex39099/PhantomSpawnControl/wiki/Basic-Configurations-%28config.yml%29
        min_score: 72000
        # If a player changes to an enabled gamemode his score will reset. This can be deactivated for specific players by permissions, please see the plugin's page for more information.
        reset_gamemodes:
          adventure: true
          creative: false
          spectator: false
          survival: true

      # If phantoms spawned for a player, how long should he be protected from another spawn?
      spawn_cooldown:
        min: 100
        max: 1000

      # Options regarding blocks above a player.
      # Please note that all block lists require material names. All available materials are listed here: https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/Material.html. Do not use legacy materials. Also if asked for blocks you should use block-materials.
      blocks:
        # Should phantoms spawn if the target player stands under a solid block?
        no_solid_above: true
        # Which solid blocks should be ignored in the check above?
        ignored_solid:
        # - ...
        # Which blocks should stop spawning if above the target player?
        add_blocks:
        # - ...

        # Configure for which worlds block-conditions should be checked.
        worlds:
          enabled_environments:
            normal: true
            nether: false
            the_end: true
          disabled_worlds:
          # - ...
      # Options regarding essentials (Essentials aka. EssentialsX must be installed).
      essentials:
        # Should phantoms spawn for afk players?
        afk_protection: false
        # Should a vanished player spawn phantoms?
        vanish_protection: false

    # Options regarding worldguard (WorldGuard must be installed).
    worldguard:
      # Should phantoms only spawn in regions that allow mob-spawn?
      check_flags: false

# Set to true if playerdata should be saved beyond logout / server restart. Currently this just affects data deactivating phantom spawning with the toggle command. (v3.0.0)
save_playerdata: true

# Set to true if no phantom should be able to target a player who deactivated phantom spawning by command.
playerdata_prevent_targeting: false

# Configure nearly all messages. toggle.enable and toggle.disable support the placeholder %player% for the player name.
messages:
  cmd:
    # This is the prefix of all command message outputs. An empty string will result in the default prefix.
    prefix: ""
    credits: "Use /psc help for all available commands."
    noPerm: "&4You do not have permission."
    wrongCmdUsagePrefix: "&CUsage:"
    noPlayerMsg: "&CThere is no such player."
    toggle:
      help: "toggles phantom spawning"
      enable: "&2Phantom spawning was activated for %player%."
      disable: "&4Phantom spawning was deactivated for %player%."
    playerstats:
      help: "shows the playerstats of a specific player"

# Options regarding the updateChecker (by mfnalex (https://github.com/JEFF-Media-GbR/Spigot-UpdateChecker))
updatechecker:
  enable: true
  notify_op_on_login: true

# Additional credits: The idea for the giant_phantoms feature is inspired by Xisumavoid's vanilla tweak data pack.

Clone this wiki locally