-
Notifications
You must be signed in to change notification settings - Fork 0
Global Functions & Statements
These are available globally in every script without needing a type instance.
Imports a reusable Vyn script library from a resource pack. Use this to share common logic across multiple scripts.
-
Parameters:
-
packId—String— The resource pack ID that contains the script -
script—String— The name of the script to import
-
importScript("mypack", "math_utils")
importScript("mypack", "animation_lib")
Disables an active script, preventing it from running.
-
Parameters:
-
packId—String— The resource pack ID that owns the script -
script—String— The name of the script to disable
-
~ Disable a script conditionally
check modLoader.isModLoaded("somemod") do
excludeScript("mypack", "compat_script")
end
Displays a debug string on screen. Only works when Resource Pack Debug Mode is enabled in the mod config (see InteractiveStuffConfig).
-
Parameters:
-
text—String— The text to display
-
debugText("Player health: " + player.getHealth())
debugText("Biome: " + player.getWorld().getBiomeAt(player.getPosition()))
debugText("Velocity Y: " + player.getVelocityY())
Returns the normalized frame delta time. Use this to make animations and transitions framerate-independent — the result scales consistently at any FPS.
-
Returns:
Double
~ Rotate item at a consistent speed regardless of FPS
make item player.getMainHandItem()
item.rotateY(90 * getDelta())
~ Smooth translation using delta
make speed 0.05
item.translateY(speed * getDelta())
Executes a block of code after a delay of the given number of ticks (20 ticks = 1 second). The rest of the script continues running immediately — the wait block runs in the background.
-
Parameters:
-
ticks—Integer— Number of ticks to wait before executing the body
-
~ Play a sound, then play another sound 1 second later
player.playSound("minecraft:entity.experience_orb.pickup", 1.0, 1.0)
wait 20 do
player.playSound("minecraft:block.note_block.bell", 1.0, 1.2)
end
~ Delayed debug message
debugText("Starting sequence...")
wait 40 do
debugText("2 seconds have passed!")
end
~ Chained waits
wait 10 do
debugText("0.5 seconds")
wait 10 do
debugText("1 second")
wait 20 do
debugText("2 seconds")
end
end
end
GET IN TOUCH - omar@merakistudios.dev
© 2026 Omar Mohamed. All Rights Reserved.