Files
domains.sk
Code
1 90
domains.sk
# ==========================================
# DOMAIN ORIGINS: GRAVITY GEM (LEVEL 1)
# ==========================================
options:
prefix: &8[&b&lDOMAINS&8]
domain_size: 3.5 # This creates a 7x7 area (3.5 radius)
cooldown: 60 seconds
# 1. THE JOIN MECHANIC (RANDOM TOKEN)
on first join:
# Giving a random token (For now, just Gravity, but you can expand this)
set {_token} to sunflower named "&b&lGravity Token &7(Level 1)" with lore "&8Bound to your soul." and "&7" and "&fAbility: &3Minor Aura" and "&fDuration: &b10s" and "&7" and "&e&lRIGHT-CLICK TO ACTIVATE"
enchant {_token} with unbreaking 1
give 1 of {_token} to player
send "{@prefix} &fYou have received a &bGravity Token&f! Guard it well."
# 2. THE SOUL-BOUND MECHANIC (CANNOT LOSE TOKEN)
on death:
set {_drops::*} to drops
loop {_drops::*}:
if name of loop-value contains "Token":
add loop-value to {keep_%player%::*}
else:
add loop-value to {_newdrops::*}
set drops to {_newdrops::*}
on respawn:
if {keep_%player%::*} is set:
give {keep_%player%::*} to player
delete {keep_%player%::*}
send "{@prefix} &fYour &bSoul-Bound Token &freturned to you."
# 3. DOMAIN ACTIVATION
on right click with sunflower:
if name of tool contains "Gravity Token":
# Cooldown Check
set {_waited} to difference between {domain_cd::%player%} and now
if {_waited} is less than {@cooldown}:
send "{@prefix} &cDomain on cooldown! &7(%difference between {@cooldown} and {_waited}% left)"
stop
# Activation
set {domain_cd::%player%} to now
set {active_domain::%player%} to true
send "{@prefix} &b&lDOMAIN EXPANSION: &3&nGravity Aura"
# Duration Loop (10 Seconds)
loop 20 times: # Runs every 0.5s for 10s
if {active_domain::%player%} is true:
# Visual Particles (Circle)
set {_center} to location of player
loop 36 times:
set {_angle} to (loop-number-2 * 10)
set {_x} to ({@domain_size} * cos({_angle}))
set {_z} to ({@domain_size} * sin({_angle}))
play flame at {_center} offset by vector({_x}, 0.1, {_z})
# Domain Effects
apply jump boost 1 to player for 1 second
# Effecting Enemies in 7x7 Area
loop all players in radius {@domain_size} around player:
if loop-player is not player:
apply slowness 2 to loop-player for 1 second
# Gravity Effect: Pull to ground
if loop-player is jumping:
push loop-player down at speed 0.5
wait 0.5 seconds
delete {active_domain::%player%}
send "{@prefix} &7Your domain has collapsed."
# 4. CRAFTING UPGRADE (EXAMPLE)
# Place Token + 4 Netherite + 4 Diamonds to upgrade
# This logic is usually handled via a custom INVENTORY GUI or Recipe registration
# How to use this for your SMP:
# Level 2 & 3 Expansion: To add the higher levels, you would create a on craft: event or a custom villager trader that checks if the player has the Level 1 Token and the required resources (Netherite/Diamonds) to exchange it for a Level 2 Token.
# The "Static" Gem: You can add a new section for the Static Gem. In the loop, instead of apply slowness, you would set the target's velocity to vector(0, 0, 0) every tick to "freeze" them in place.
# Visuals: I used flame particles in the script for simplicity. For a "Gravity" feel, you could change that to portal or squid_ink particles to give it a darker, heavier look.
# Why this fits your style:
# Scroll-Wheel Friendly: Since it activates on Right-Click, you can keep the token in a specific hotbar slot and quickly scroll to it, right-click, and scroll back to your sword or mace without breaking your combat rhythm.
# Tactical: The 60-second cooldown ensures players don't just spam domains; they have to wait for the right moment to trap an enemy.