SETUP
TESTED VERSIONS
- Transfer the “.sk” extension file in the package you downloaded to the “Skript/scripts” section in the plugin folder on your server.
- Transfer the folder where the “.sk” extension file in the package you downloaded stores the data into the plugin folder.
- Install the required plugins/skript addons on your server.
- Use the command “/reload” to activate the script. Or restart the server.
- /attributepotions give <player> <id> [amount] [splash] | attributepotions.nq.admin
- /attributepotions attribute <apply/clear> <player>... | attributepotions.nq.admin
- /attributepotions check <id> [splash] | attributepotions.nq.admin
- /attributepotions info <attribute> | attributepotions.nq.admin
- /attributepotions reload [module] | attributepotions.nq.admin
TESTED VERSIONS
- 1.21, 1.21.4, 1.21.5
Code:
options:
folderPath: plugins/Skript/scripts/nqaaN's Skripts/Attribute Potions # Do not change this unless you are an advanced user!
permission_attributepotions_admin: attributepotions.nq.admin
# --- Config
actionbar_information: true # If true, shows active potion status on the actionbar.
actionbar_attribute_limit: 3 # Maximum number of attributes shown in actionbar
actionbar_low_threshold: 200 # Duration (tick) threshold to trigger "lang_actionbar_low_format" format (e.g., 200 means last 200 ticks(10 seconds) of duration)
bossbar_information: false # If true, shows active potion status on the bossbar. (Shows the potion with the shortest duration)
# Color Options: blue, green, pink, purple, red, white, yellow
bossbar_default_color: purple # Default color of the bossbar
bossbar_low_color: red # Color to switch to when potion duration/progress is low
bossbar_low_threshold: 200 # The value for triggering the low color.
bossbar_threshold_is_percentage: false # If true, the value above means percentage (%). If false, it means ticks.
allow_potion_refresh: true # If true, drinking the same potion resets its duration.
allow_overlapping_attributes: true # If true, multiple potions can affect the same attribute; (otherwise for Consuming)
clear_attributes_on_quit: false # If true, all active attributes are removed when the player logs out.
keep_attributes_on_death: false # If true, attributes stay active after death (until duration ends).
max_active_potions: 3 # Set to 0 for unlimited.
bypass_limit_with_splash: false # If true, splash potions can exceed the max limit, allowing extra active effects.
splash_radius: 3.6 # Max distance (blocks) to affect players.
use_proximity_duration: true # If true, duration scales by distance; otherwise full.
enable_tabComplete_module: true
# --- Settings
# These are the default values that attributes will revert to when no potions are active.
# Reference: https://minecraft.wiki/w/Attribute
default_attribute_armor: 0
default_attribute_armor_toughness: 0
default_attribute_attack_damage: 1
default_attribute_attack_knockback: 0
default_attribute_attack_speed: 4
default_attribute_block_break_speed: 1
default_attribute_block_interaction_range: 4.5
default_attribute_burning_time: 1
default_attribute_entity_interaction_range: 3
default_attribute_explosion_knockback_resistance: 0
default_attribute_fall_damage_multiplier: 1
default_attribute_flying_speed: 0.4 # Using global default (No player-specific value)
default_attribute_follow_range: 32 # Using global default (No player-specific value)
default_attribute_gravity: 0.08
default_attribute_jump_strength: 0.42
default_attribute_knockback_resistance: 0
default_attribute_luck: 0
default_attribute_max_absorption: 0
default_attribute_max_health: 20
default_attribute_mining_efficiency: 0
default_attribute_movement_efficiency: 0
default_attribute_movement_speed: 0.1
default_attribute_oxygen_bonus: 0
default_attribute_safe_fall_distance: 3
default_attribute_scale: 1
default_attribute_spawn_reinforcements: 0 # Using global default (No player-specific value)
default_attribute_sneaking_speed: 0.3
default_attribute_step_height: 0.6
default_attribute_submerged_mining_speed: 0.2
default_attribute_sweeping_damage_ratio: 0
default_attribute_tempt_range: 10 # Using global default (No player-specific value)
default_attribute_water_movement_efficiency: 0
# --- Lang
lang_prefix: "" # If the message contains more than one text, it works with the [prefix] placeholder.
lang_no_permission: "&cYou don't have permission to use this command!" # Placeholders > [permission]
lang_this_cmd_doesnt_exists: "&e/attributepotions &6[command]" and " &6• &cThis command doesn't exist!" # Placeholders > [command]
lang_this_cmd_for_players_msg: "&cOnly players can use this command!"
lang_help: "&8&m● • ● • ●&r &6nqaaN's Attribute Potions Skript &8&m● • ● • ●&r", "&e/attributepotions give <player> <id> [amount] [splash]", " &6• &7Give an attribute potion.", "&e/attributepotions attribute <apply/clear> <player>...", " &6• &7Directly manage attributes on a player.", "&e/attributepotions check <id> [splash]", " &6• &7Check all settings of a potion.", "&e/attributepotions info <attribute>", " &6• &7Check original attribute values or compare with a potion.", "&e/attributepotions reload [module]", " &6• &7Reload the skript." and "&8&m● • ● • ●&r &6nqaaN's Attribute Potions Skript &8&m● • ● • ●&r"
lang_give_arg2_error: "&e/attributepotions give &6[player]" and " &6• &cThis player couldn't found." # Placeholders > [player]
lang_give_arg2_else: "&e/attributepotions give <player>" and " &6• &7Type a player name."
lang_give_arg3_error: "&e/attributepotions give [player] &6[id]" and " &6• &cThis potion id doesn't exist." # Placeholders > [player] | [id]
lang_give_arg3_else: "&e/attributepotions give [player] <id> [amount] [splash]" and " &6• &7Type a potion id." # Placeholders > [player]
lang_give_arg4_error: "&e/attributepotions give [player] [id] &6[amount]" and " &6• &cEnter a number that starts with at least 0" # Placeholders > [player] | [id] | [amount]
lang_give_arg5_error: "&e/attributepotions give [player] [id] [amount] &6[splash]" and " &6• &cUse the values 'true/false'" # Placeholders > [player] | [id] | [amount] | [splash]
lang_attribute_arg2_error: "&e/attributepotions attribute &6[argument]" and " &6• &cThis argument doesn't exist." # Placeholders > [argument]
lang_attribute_arg2_else: "&e/attributepotions attribute <apply/clear>" and " &6• &7Type one of these arguments."
lang_attribute_arg2_apply_arg2_error: "&e/attributepotions attribute apply &6[player]" and " &6• &cThis player couldn't found." # Placeholders > [player]
lang_attribute_arg2_apply_arg2_else: "&e/attributepotions attribute apply <player>" and " &6• &7Type a player name."
lang_attribute_arg2_apply_arg3_error: "&e/attributepotions attribute apply [player] &6[id]" and " &6• &cThis potion id doesn't exist." # Placeholders > [player] | [id]
lang_attribute_arg2_apply_arg3_else: "&e/attributepotions attribute apply [player] <id>" and " &6• &7Type a potion id." # Placeholders > [player]
lang_attribute_arg2_clear_arg2_error: "&e/attributepotions attribute clear &6[player]" and " &6• &cThis player couldn't found." # Placeholders > [player]
lang_attribute_arg2_clear_arg2_else: "&e/attributepotions attribute clear <player> [id]" and " &6• &7Type a player name."
lang_attribute_arg2_clear_arg3_error: "&e/attributepotions attribute clear [player] &6[id]" and " &6• &cThis potion id doesn't exist." # Placeholders > [player] | [id]
lang_check_arg2_error: "&e/attributepotions check &6[id]" and " &6• &cThis potion id doesn't exist." # Placeholders > [id]
lang_check_arg2_else: "&e/attributepotions check <id> [splash]" and " &6• &7Type a potion id."
lang_check_arg3_error: "&e/attributepotions check [id] &6[splash]" and " &6• &cUse the values 'true/false'" # Placeholders > [id] | [splash]
lang_info_arg2_error: "&e/attributepotions info &6[attribute]" and " &6• &cThis attribute doesn't exist." # Placeholders > [attribute]
lang_info_arg2_else: "&e/attributepotions info <attribute>" and " &6• &7Type an attribute."
lang_reload_arg2_error: "&e/attributepotions reload &6[module]" and " &6• &cThis module doesn't exist." # Placeholders > [module]
lang_potion_given_admin: "&aGiven &e[potion_name] &ato &e[player]&a." # Placeholders > [id] | [amount] | [display_name] | [potion_name] | [duration] | [tick_duration] | [player]
lang_potion_given_player: "&aYou have received &e[potion_name]&a." # Placeholders > [id] | [amount] | [display_name] | [potion_name] | [duration] | [tick_duration] | [admin]
lang_attribute_applied_admin: "&aApplied &e[id] &aattribute to &e[player]&a." # Placeholders > [id] | [display_name] | [duration] | [tick_duration] | [player]
lang_attribute_applied_player: "&aAn administrator has applied the &e[id] &aattribute to you." # Placeholders > [id] | [display_name] | [duration] | [tick_duration] | [admin]
lang_attribute_cleared_admin: "&e[id] &aattribute of &e[player] &ahas been cleared." # Placeholders > [id] | [display_name] | [player]
lang_attribute_cleared_player: "" # Placeholders > [id] | [display_name] | [admin]
lang_all_attributes_cleared_admin: "&aAll active attribute potions of &e[player] &ahave been cleared." # Placeholders > [player]
lang_all_attributes_cleared_player: "" # Placeholders > [admin]
lang_potion_check: "&8&m● • ● • ●&r &6nqaaN's Attribute Potions Skript &8&m● • ● • ●&r", "&ePotion Information: &6[id]", " &6• &7Potion Name: &6[name]", " &6• &7Duration: &6[tick_duration]([duration])", "&r", "&eAttributes:", "&r[attributes]", "&r", "&eContents:", " &6• &7Show Information: &6[show_information]", " &6• &7Clearable with Milk: &6[clearable_with_milk]", " &6• &7Show Particles: &6[show_particles]", " &6• &7Ambient: &6[ambient]" and "&8&m● • ● • ●&r &6nqaaN's Attribute Potions Skript &8&m● • ● • ●&r" # Placeholders > [id] | [name] | [duration] | [tick_duration] | [attributes] | [show_information] | [clearable_with_milk] | [show_particles] | [ambient]
long_potion_check_attributes: " &6• &7[attribute]: &6[default_value] → [value]" # Placeholders > [attribute] | [default_value] | [value]
long_potion_check_attributes_empty: " &6• &cThere are no attributes."
lang_attribute_info: "&8&m● • ● • ●&r &6nqaaN's Attribute Potions Skript &8&m● • ● • ●&r", "&eAttribute Information: &6[attribute]", " &6• &7Default in Settings: &6[default_setting_value]", " &6• &7Default(of Player): &6[default_value]", " &6• &7Minimum: &6[minimum_value]", " &6• &7Maximum: &6[maximum_value]", "&c&o( According to &e&n&o[wiki]&c&o )" and "&8&m● • ● • ●&r &6nqaaN's Attribute Potions Skript &8&m● • ● • ●&r" # Placeholders > [attribute] | [default_setting_value] | [default_value] | [minimum_value] | [maximum_value] | [wiki]
lang_potion_not_found: "&cThis potion is no longer valid or has been removed." # Placeholders > [id]
lang_max_potion_limit_reached: "&cYou've reached the max. limit of &e[limit] &cactive attribute potions!" # Placeholders > [limit]
lang_potion_already_active: "&cYou are already under the effect of this potion." # Placeholders > [id] | [display_name] | [potion_name]
lang_attribute_already_active: "&cYou already have an active potion with the same attribute."
lang_actionbar_prefix: "&8&l⚡ " # The prefix (left side) of the actionbar list
lang_actionbar_suffix: " &8&l⚡" # The suffix (right side) of the actionbar list
lang_actionbar_separator: " &8● " # The separator between multiple active attributes
lang_actionbar_format: "&e[display_name] &7([duration])" # Placeholders > [id] | [display_name] | [duration] | [tick_duration]
lang_actionbar_low_format: "&e[display_name] &c([duration])" # Placeholders > [id] | [display_name] | [duration] | [tick_duration]
lang_bossbar_format: "&e[display_name] &7([duration])" # Placeholders > [id] | [display_name] | [duration] | [tick_duration]
lang_bossbar_low_format: "&e[display_name] &c([duration])" # Placeholders > [id] | [display_name] | [duration] | [tick_duration]
on load:
loop {attributePotions_potions::*}:
delete {attributePotions_potions::%loop-value%::color::*}
delete {attributePotions_potions::%loop-value%::effects::*}
delete {attributePotions_potions::%loop-value%::potion_lore::*}
delete {attributePotions_potions::%loop-value%::splash_potion_lore::*}
delete {attributePotions_potions::%loop-value%::drink_message::*}
delete {attributePotions_potions::%loop-value%::drink_permission_message::*}
delete {attributePotions_potions::%loop-value%::drink_sound::*}
delete {attributePotions_potions::%loop-value%::*}
delete {attributePotions_potions::*}
# --- Config (You will edit this section)
#
# [IMPORTANT] PRIORITY & LAYERING SYSTEM
#
# 1. PRIORITY: Potions are registered from TOP to BOTTOM.
# The potion HIGHER in this list always takes control of
# the attribute if multiple potions are active.
#
# 2. LAYERING: If a higher-priority potion expires, the next
# active potion in the list takes over INSTANTLY.
#
# 3. BACKGROUND: All active potions continue their countdown
# simultaneously in the background, even if they are
# currently overridden by a higher-priority effect.
#
# 4. RESET: When NO potions are active,
# attributes revert to the values in "Settings".
#
# EXAMPLE SCENARIO
#
# * Potion A (Scale: 2.0) [Top of list]
# * Potion B (Scale: 0.5) [Bottom of list]
#
# If both are used: Scale becomes 2.0.
# When A ends: Scale becomes 0.5.
# When B ends: Reverts to Default from "Settings".
#
#
# FUNCTIONS & USAGE
#
# * create_potion("id", duration, "display_name", "potion_name", color)
# > duration: Minimum = 20 (1 second) | Maximum = 1728000 (1 day)
# > color: Expects a DECIMAL value. You can use these helper functions:
# calculate_hex_to_decimal("#f000ee") or calculate_rgb_to_decimal(240, 0, 238)
#
# * add_potion_lore("id", "lore")
# > Placeholders: [duration], [tick_duration]
#
# * add_potion_attribute("id", "attribute", value)
#
# * set_potion_contents("id", show_info, milk_clearable, particles, ambient)
# > show_information: Default = true
# > clearable_with_milk: Default = true
# > show_particles: Default = true
# > ambient: Default = false
#
# Splash Settings:
# * set_potion_splash_duration("id", duration)
# * set_potion_splash_name("id", "name")
# > If not set, the default name is used.
# > Placeholders: [name]
# * add_potion_splash_lore("id", "lore")
# > If not set, the default lore is used.
# > Placeholders > [duration] | [tick_duration]
#
# Interaction:
# * add_potion_drink_message("id", "message")
# * set_potion_drink_permission("id", "permission")
# * add_potion_drink_permission_message("id", "message")
# * set_potion_drink_sound("id", "sound", volume, pitch)
# > sound: Minecraft sound name (e.g., "entity.generic.drink" or "block.note_block.pling")
# > volume: Default = 1.0
# > pitch: Default = 1.0
# GIANT
create_potion("giant", 900, "Giant", "&bAttribute Potion of Giant", 14901760)
set_potion_splash_duration("giant", 900 / 2.5)
set_potion_splash_name("giant", "&bSplash [name]")
add_potion_lore("giant", "&9+200%% Scale ([duration])")
add_potion_lore("giant", "&7Feel the power of the titans!")
add_potion_attribute("giant", "scale", 3)
add_potion_attribute("giant", "movement_speed", 0.05)
add_potion_attribute("giant", "jump_strength", 0.42) # Resets jump strength to default to override "mini" potion's effect
add_potion_attribute("giant", "step_height", 1.2)
set_potion_contents("giant", true, true, true, true)
set_potion_drink_sound("giant", "entity.iron_golem.attack", 1, 0.5)
# MINIFICATION
create_potion("mini", 1200, "Minification", "&bAttribute Potion of Minification", 43520)
set_potion_splash_duration("mini", 1200 / 3)
set_potion_splash_name("mini", "&bSplash [name]")
add_potion_lore("mini", "&9-50%% Scale ([duration])")
add_potion_lore("mini", "&7Small enough to hide in the shadows.")
add_potion_attribute("mini", "scale", 0.5)
add_potion_attribute("mini", "movement_speed", 0.135)
add_potion_attribute("mini", "jump_strength", 0.372)
set_potion_contents("mini", true, true, true, true)
set_potion_drink_sound("mini", "entity.bat.takeoff", 1, 1.5)
# LIGHTWEIGHT
create_potion("lightweight", 2400, "Lightweight", "&eAttribute Potion of Lightweight", 10092543)
set_potion_splash_name("lightweight", "&eSplash [name]")
add_potion_lore("lightweight", "&9-60%% Fall Damage ([duration])")
add_potion_lore("lightweight", "&7Feel light as a feather on your feet.")
add_potion_attribute("lightweight", "fall_damage_multiplier", 0.4)
# VITALITY
create_potion("vita", 3600, "Vitality", "&dAttribute Potion of Vitality", 11872294)
set_potion_splash_duration("vita", 1200)
set_potion_splash_name("vita", "&dSplash [name]")
add_potion_lore("vita", "&9+20 Max Health ([duration])")
add_potion_lore("vita", "&7Your heart beats with ancient strength.")
add_potion_attribute("vita", "max_health", 40)
set_potion_contents("vita", true, false, true, false)
# MOON WALK
create_potion("moon_walk", 1800, "Moon Walk", "&eAttribute Potion of Moon Walk", 13631487)
set_potion_splash_name("moon_walk", "&eSplash [name]")
add_potion_lore("moon_walk", "&9Low Gravity ([duration])")
add_potion_lore("moon_walk", "&7One small step for a player...")
add_potion_attribute("moon_walk", "gravity", 0.015)
add_potion_attribute("moon_walk", "safe_fall_distance", 13)
set_potion_contents("moon_walk", true, true, true, true)
# UNSTOPPABLE
create_potion("unstoppable", 900, "Unstoppable", "&eAttribute Potion of Unstoppable", 1908001)
set_potion_splash_name("unstoppable", "&eSplash [name]")
add_potion_lore("unstoppable", "&9+100%% Knockback Resistance ([duration])")
add_potion_lore("unstoppable", "&7A living fortress that cannot be moved.")
add_potion_attribute("unstoppable", "knockback_resistance", 1)
# REACHER
create_potion("reacher", 1800, "Reacher", "&6Attribute Potion of Reacher", 16753920)
add_potion_lore("reacher", "&9+2 Block Reach ([duration])")
add_potion_lore("reacher", "&7Touch the untouchable.")
add_potion_attribute("reacher", "block_interaction_range", 6)
set_potion_drink_sound("reacher", "entity.player.attack.sweep", 1, 1.5)
# AQUATIC
create_potion("aquatic", 2400, "Aquatic", "&3Attribute Potion of Aquatic", 255)
add_potion_lore("aquatic", "&9Water Mastery ([duration])")
add_potion_attribute("aquatic", "submerged_mining_speed", 1)
add_potion_attribute("aquatic", "oxygen_bonus", 5)
add_potion_attribute("aquatic", "movement_efficiency", 1)
# BERSERKER
create_potion("berserk", 600, "Berserker", "&4Attribute Potion of Berserker", 11534336)
add_potion_lore("berserk", "&c+50%% Attack Speed")
add_potion_lore("berserk", "&7A flurry of strikes!")
add_potion_attribute("berserk", "attack_speed", 6)
add_potion_attribute("berserk", "movement_speed", 0.05)
set_potion_drink_sound("berserk", "entity.zombie_villager.cure", 1, 0.5)
# CURSED
create_potion("cursed", 300, "Cursed", "&0Attribute Potion of Cursed", 0)
add_potion_lore("cursed", "&c-50%% Max Health")
add_potion_lore("cursed", "&cWeakness & Slowness")
add_potion_attribute("cursed", "max_health", 10)
add_potion_attribute("cursed", "movement_speed", 0.06)
add_potion_attribute("cursed", "attack_damage", 0.5)
set_potion_contents("cursed", true, false, true, true)
set_potion_drink_sound("cursed", "entity.witch.celebrate", 1, 0.8)
