-
-
Notifications
You must be signed in to change notification settings - Fork 1
Starscript
Starscript is the formatting language currently used in various aspects of Meteor. Full syntax information can be found here.
A list of standard library functions/variables can be found here.
The following categories (until Objects) have up to 2 sections: Variables and Functions.
-
Variables are accessed just by name, after a dot accessor if the variable is on an object (just
player
is also valid). For example,player.health
:player
is the object, in this case your player, the dot accesses that object and allows you to use values on that object. In this case,health
is the value on the object we're accessing. -
Functions cannot be accessed and only called. You call a function by using
()
, with variables/values inside of the parenthesis if the function has arguments (all Starscript functions do, this isn't the case for regular programming though). For example,player.getItem(slot)
: Again, hereplayer
is the object, and is being accessed by the dot. You then follow it up with the name of the function and the parenthesis with the comma-separated (if multiple) values of arguments to give the function. In the example given,player.getItem(slot)
, the argument isslot
, which is the inventory slot number you want to get the item of. An example call togetItem
isplayer.getItem(0)
which retrieves the item in the very first slot in your hotbar.
-
kotlin
- Currently loaded version of Kotlin. -
gameVersion
- Current Minecraft version. -
fps
- Current FPS. -
ping
- Your ping. -
time
- A formatted version of your system's current time.
-
meteor.isModuleActive(id)
- Returns value of true when the module with the specified ID is active.-
id
should be of typeString
.
-
-
meteor.getModuleInfo(id)
- Returns an informational string about the module.-
id
should be of typeString
.
-
-
meteor.version
- Current version & revision of this fork of Meteor. -
meteor.modules
- Number of currently loaded modules. -
meteor.activeModules
- Number of currently active modules.
-
baritone.isPathing
: Whether or not Baritone is actively controlling your Minecraft player. -
baritone.distanceToGoal
: Approximate distance to the current Baritone pathing goal. -
baritone.process
: Current Baritone process. Relatively long result typically. -
baritone.processName
: Current Baritone process name, such as "Mine."
-
camera.pos.{x, y, z}
: Camera's X/Y/Z coordinate, respectively.- Proper usage example:
camera.pos.x
.
- Proper usage example:
-
camera.posOpposite.{x, y, z}
: Camera's X/Y/Z coordinate, respectively, in the opposite dimension.- Proper usage example is similar to above.
-
camera.yaw
: Camera's yaw (horizontal) rotation. -
camera.pitch
: Camera's pitch (vertical) rotation. -
camera.direction
: Camera's cardinal or ordinal direction.
-
mods
- The amount of mods currently loaded by Fabric. -
mods.list
- A comma-separated list of mods currently loaded by Fabric. -
mods.*
- This one is different.
- When typing the dot accessor in Meteor, you'll see a lot of autocompletions. Simply type the mod ID (usually a shorter version of the mod name) you want until you see it in the suggestions list (easiest way to verify it's the actual name). You now have the Mod object associated with the mod of that ID.
- This one is different.
-
player.hasPotionEffect(id)
: Checks whether you have the specified potion effect. -
player.getPotionEffect(id)
: Returns the effect with the given ID if the player has it, null otherwise. See Potion Effect. -
player.getStat(id)
,player.getStat(id, type)
: Returns the specified statistic for yourself.- Supported Stat IDs
mined
crafted
used
broken
picked_up
killed
killed_by
-
custom
(default)
- Supported Stat IDs
-
player
: Your username. -
player.health
: Your health. -
player.hunger
: Your hunger. -
player.speed
: Your speed in blocks/second. -
player.breakingProgress
: Your progress in breaking the block you're currently mining. -
player.biome
: The biome you're currently in. -
player.dimension
: The dimension you're currently in. -
player.dimensionOpposite
: The opposite dimension to the one you're currently in. -
player.pos
: Your position in the world, formatted asX: _ Y: _ Z: _
. -
player.pos.{x, y, z}
: The specific X/Y/Z coordinate you're located in.- Proper usage example:
player.pos.z
.
- Proper usage example:
-
player.posOpposite.{x, y, z}
: The specific X/Y/Z coordinate of the opposite dimension to the one you're currently in.- Proper usage example is similar to the above.
-
player.yaw
: Your player's yaw (horizontal) rotation. -
player.pitch
: Your player's pitch (vertical) rotation. -
player.direction
: Your player's cardinal or ordinal direction. -
player.hand
: The item stack currently in your main hand. See Item. -
player.offhand
: The item stack currently in your offhand. See Item. -
player.handOrOffhand
: Your main item stack. See Item. -
player.xp.{level, progress, total}
: Your various XP values.level
is your current level,progress
is your percentage of XP bar towards the next level, andtotal
is the total number of experience points you have.- Proper usage example:
player.xp.progress
- Proper usage example:
-
crosshairTarget.type
- One of [miss
,block
,entity
] string. -
crosshairTarget.value
- Either an empty String, a Block, or an Entity.
-
server
- Current server's name in your Server list. -
server.ip
- Current server's IP address. -
server.tps
- Current server's ticks/second. -
server.time
- Current server's time in 24h format. -
server.playerCount
- Current server's online player count. -
server.difficulty
- Current server world's difficulty.
Various variables and functions can return more complex objects on which other objects or values can be accessed on via the dot accessor.
On the items listed below, _toString
is not to be called or accessed. It is simply the result that is achieved from using the object itself as a value rather than accessing a field or function on it.
-
_toString
- Item name formatted as<name> x<count>
(likeSculk x13
), or just<name>
if there's only one item. -
name
- The name of the item type. -
count
- Number of items in the stack. -
isTool
- Whether or not this ItemStack contains a tool item.- Useful in tandem with
durability
/durabilityMax
to determine if there's a meaningful value with those.
- Useful in tandem with
-
durability
- Current durability of the tool in this stack; or 0 if there is no tool. -
durabilityMax
- The maximum durability of the tool in this stack; or 0 if there is no tool.
-
_toString
- Block name -
pos
- Block position in the world, formatted asX: _ Y: _ Z: _
. -
pos.{x, y, z}
: The specific X/Y/Z coordinate the block is at.- Proper usage example:
pos.z
.
- Proper usage example:
-
_toString
- Entity name -
health
- Entity health, or 0 if the entity doesn't have health. -
pos
- Entity position in the world, formatted asX: _ Y: _ Z: _
. -
pos.{x, y, z}
: The specific X/Y/Z coordinate the entity is at.- Proper usage example is identical to the example provided in Block.
-
_toString
- Potion effect type name -
duration
- Effect duration, in game ticks. -
level
- Effect level
-
_toString
- Mod name -
authors
- Comma separated list of authors of the mod. -
version
- Mod version -
description
- Description of the mod from itsfabric.mod.json
. -
getValue(id)
- Get a custom value of with the specified ID from the mod'sfabric.mod.json
.