Documentation
Reference
Every module, function, type and event of Flint 1.0.0, generated from the plugin itself.
542 entries
- abs(number)Absolute value.
- blockA block in a world.Paper
- block.biome: textBiome at the block, such as plains.Paper
- block.breakA player broke a block.Paper
- block.burnA block is being destroyed by fire.Paper
- block.damageA player started hitting a block.Paper
- block.data: textFull block state, e.g.Paper
- block.destroy()Breaks the block and drops its items.Paper
- block.explodeA block (a bed, a respawn anchor...) is exploding.Paper
- block.fadeA block is melting, decaying or drying out.Paper
- block.formA block is forming (snow, ice, obsidian...).Paper
- block.growA crop or plant is growing.Paper
- block.igniteA block is being set on fire.Paper
- block.is_air: boolTrue for air.Paper
- block.is_liquid: boolTrue for water and lava.Paper
- block.is_solid: boolTrue if entities cannot walk through it.Paper
- block.light: numberLight level at the block, 0 to 15.Paper
- block.location: locationLocation of the block.Paper
- block.placeA player placed a block.Paper
- block.power: numberRedstone power reaching the block, 0 to 15.Paper
- block.relative(x, y, z)The block that many steps away, e.g.Paper
- block.spreadA block is spreading (fire, grass, mushrooms...).Paper
- block.type: textBlock type, such as stone.Paper
- block.world: worldThe world.Paper
- block.x: numberX coordinate.Paper
- block.y: numberY coordinate.Paper
- block.z: numberZ coordinate.Paper
- bossbarA boss bar from the bossbars module.
- bossbar.color: textpink, blue, red, green, yellow, purple or white.
- bossbar.hide([player])Hides the bar from one player, or from everyone.
- bossbar.progress: numberHow full the bar is, 0 to 1.
- bossbar.show(player)Shows the bar to a player (or a list of players).
- bossbar.style: textsolid, or 6, 10, 12, 20 for that many segments.
- bossbar.title: textText on the bar.
- bossbar.viewers: numberHow many players currently see the bar.
- bossbarsBoss bars at the top of the screen: progress, countdowns, announcements.
- bossbars.create(title, [progress], [color], [style])Creates a boss bar.
- ceil(number)Rounds up.
- cooldownsSimple cooldowns keyed by any text, e.g.
- cooldowns.active(key)True while the cooldown is still running.
- cooldowns.clear(key)Ends a cooldown now.
- cooldowns.left(key)Seconds left on a cooldown (0 when it is over).
- cooldowns.ready(key, duration)True if the cooldown is over, and starts it again.
- cooldowns.start(key, duration)Starts (or restarts) a cooldown without checking it.
- databaseA SQL database connection pool.
- database.batch(sql, rows)Runs one statement for every list of params in rows.
- database.begin()Starts a transaction.
- database.close()Closes the connection pool.
- database.execute(sql, [params])Runs INSERT, UPDATE, DELETE or DDL.
- database.first(sql, [params])Runs a SELECT and returns the first row, or none.
- database.name: textName of the database connection.
- database.query(sql, [params])Runs a SELECT.
- database.type: textmysql, mariadb, postgresql or sqlite.
- dbSQL databases: MySQL, MariaDB, PostgreSQL and SQLite.
- db.connect(url, [username], [password])Connects with a URL: mysql://user:pass@host:3306/db, mariadb://..., postgresql://...
- db.get(name)A database configured in config.properties as db.<name>.*
- db.names()Names of the databases configured in config.properties.
- durationA length of time, written like 5 seconds or 2 minutes.
- duration.millis: numberLength in milliseconds.
- duration.seconds: numberLength in seconds.
- duration.ticks: numberLength in game ticks.
- economyMoney through Vault and whichever economy plugin the server uses.Paper
- economy.available()True if Vault and an economy plugin are installed.Paper
- economy.balance(player)How much money a player has.Paper
- economy.currency()Name of the currency (plural).Paper
- economy.deposit(player, amount)Gives money.Paper
- economy.format(amount)The amount as the economy plugin writes it, e.g.Paper
- economy.has(player, amount)True if the player has at least that much.Paper
- economy.withdraw(player, amount)Takes money.Paper
- entitiesSpawn and find entities.Paper
- entities.near(location, radius)Entities within a radius of a location.Paper
- entities.spawn(location, type)Spawns an entity such as "zombie" and returns it.Paper
- entityAny entity: a mob, an item, a player...Paper
- entity.breedTwo animals are having a baby.Paper
- entity.combustAn entity is catching fire.Paper
- entity.custom_name: textName tag shown above the entity.Paper
- entity.damageAn entity (including players) is taking damage.Paper
- entity.deathAn entity died.Paper
- entity.eject()Throws off every passenger.Paper
- entity.explodeAn entity (TNT, creeper...) is exploding.Paper
- entity.fire_ticks: numberTicks the entity keeps burning (0 is not on fire).Paper
- entity.glowing: boolWhether the entity has a glowing outline.Paper
- entity.gravity: boolWhether gravity pulls the entity down.Paper
- entity.healAn entity is regaining health.Paper
- entity.invulnerable: boolWhether the entity cannot be hurt.Paper
- entity.is_player: boolTrue if the entity is a player.Paper
- entity.is_valid: boolFalse once the entity is removed or dead.Paper
- entity.location: locationWhere the entity is.Paper
- entity.name: textName of the entity.Paper
- entity.nearby(radius)Other entities within a radius.Paper
- entity.on_ground: boolTrue if the entity is standing on a block.Paper
- entity.passengers: listEntities riding this one.Paper
- entity.push(x, y, z)Sets the entity's velocity, e.g.Paper
- entity.remove()Removes the entity from the world.Paper
- entity.ride(vehicle)Makes this entity ride another one.Paper
- entity.run(function, ...args)Runs a function on the thread that owns this entity.Paper
- entity.set_tag(key, value)Saves custom data on the entity (text, number, list, map).Paper
- entity.shoot_bowAn entity is shooting a bow or crossbow.Paper
- entity.silent: boolWhether the entity makes no sounds.Paper
- entity.spawnA creature is spawning.Paper
- entity.tag(key)Custom data saved on the entity with set_tag, or none.Paper
- entity.tameAn animal is being tamed.Paper
- entity.targetA mob is choosing (or forgetting) a target.Paper
- entity.teleport(location)Teleports the entity (to a location, entity or block).Paper
- entity.teleportA non-player entity is teleporting (endermen, chorus fruit...).Paper
- entity.type: textEntity type, such as zombie.Paper
- entity.uuid: textUnique id.Paper
- entity.vehicle: entityWhat the entity is riding, or none.Paper
- entity.world: worldThe world the entity is in.Paper
- eventThe raw event inside an 'on' block.Paper
- eventAny event of the server or of another plugin, by class name: on event "PlayerBedLeaveEvent": Read its data through 'event' (event.bed, event.player...).Paper
- event.cancelled: boolWhether the event is cancelled.Paper
- event.name: textBukkit name of the event.Paper
- filesRead and write text and JSON files in the plugin's 'files' folder, without blocking the server.
- files.append(path, text)Adds a line to the end of a file.
- files.delete(path)Deletes a file or an empty folder.
- files.exists(path)True if the file or folder exists.
- files.lines(path)Lines of a file as a list (empty if it does not exist).
- files.list([folder])Names of the files and folders in a folder (folders end with /).
- files.read(path)Text of a file, or none if it does not exist.
- files.read_json(path, [default])Decoded JSON content of a file, or the default if it does not exist.
- files.write(path, text)Writes a file, replacing what was there.
- files.write_json(path, value)Writes a value (map, list...) to a file as readable JSON.
- floor(number)Rounds down.
- format(number, [decimals])A number with thousands separators, e.g.
- furnace.smeltA furnace finished smelting an item.Paper
- httpHTTP requests to web APIs and webhooks.
- http.get(url, [headers])GET request.
- http.json(url, [headers])GET request that returns the decoded JSON body.
- http.post(url, [body], [headers])POST request.
- http.request(method, url, [body], [headers])Request with any method: PUT, PATCH, DELETE...
- int(value)Drops the decimals of a number (also converts text).
- inventoriesCreate custom inventories (menus).Paper
- inventories.create(title, [rows])Creates a chest-style menu with 1 to 6 rows.Paper
- inventoryAn inventory: a player's, a chest's or a custom menu.Paper
- inventory.add(item, [amount])Adds an item to the first free slot.Paper
- inventory.clear()Empties the inventory.Paper
- inventory.clickA player clicked a slot in an inventory.Paper
- inventory.closeA player closed an inventory.Paper
- inventory.contains(type, [amount])True if the inventory has at least that many of a type.Paper
- inventory.count(type)How many items of a type are in the inventory.Paper
- inventory.get(slot)The item in a slot, or none.Paper
- inventory.openA player is opening an inventory.Paper
- inventory.remove(item, [amount])Removes items of a type.Paper
- inventory.set(slot, item)Puts an item in a slot (none empties it).Paper
- inventory.size: numberNumber of slots.Paper
- itemA stack of items.Paper
- item.amount: numberNumber of items in the stack.Paper
- item.copy()A separate copy of the stack.Paper
- item.craftA player is taking a crafted item out of the grid.Paper
- item.damage: numberHow worn a tool is (0 is new).Paper
- item.enchant(type, [level])Adds an enchantment, e.g.Paper
- item.enchantA player is enchanting an item at a table.Paper
- item.enchantments: mapEnchantments on the item as a map of name to level.Paper
- item.glow: boolEnchantment shine without an enchantment.Paper
- item.hide_details()Hides enchantments, attributes and other extra tooltip lines.Paper
- item.is_similar(other)True if both are the same kind of item with the same name, lore and tags (amount is ignored).Paper
- item.lore: listLore lines.Paper
- item.max_stack: numberHow many fit in one stack.Paper
- item.model: numberCustom model number for resource packs (none if unset).Paper
- item.name: textCustom name (none if not renamed).Paper
- item.set_tag(key, value)Saves custom data on the item (text, number, list, map).Paper
- item.spawnAn item is dropping into the world.Paper
- item.tag(key)Custom data saved on the item with set_tag, or none.Paper
- item.type: textItem type, such as diamond_sword.Paper
- item.unbreakable: boolWhether the item never loses durability.Paper
- itemsCreate items.Paper
- items.exists(type)True if the name is a known item or block type.Paper
- items.head(owner, [name])A player head showing the skin of a player (or of a player name).Paper
- items.of(type, [amount], [name])Creates an item stack, e.g.Paper
- javaDirect access to Java classes of the server and other plugins, for anything Flint has no module for.
- java.class_of(value)Full Java class name of a value.
- java.members(value)Method names the Java bridge can call on a value (in Java spelling).
- java.type(class_name)A Java class by its full name, e.g.
- jsonConvert values to and from JSON text.
- json.decode(text)Value for a JSON text.
- json.encode(value)JSON text for a value.
- json.pretty(value)Indented JSON text for a value.
- len(value)Length of a text, list or map.
- lightning.strikeLightning is striking.Paper
- listAn ordered list of values.
- list.add(value)Appends a value.
- list.clear()Removes everything.
- list.contains(value)True if the list has the value.
- list.copy()A new list with the same items.
- list.first: anyFirst item, or none.
- list.index_of(value)Index of the value, or -1.
- list.insert(index, value)Inserts a value at an index.
- list.join([separator])Joins the items into text.
- list.last: anyLast item, or none.
- list.pop()Removes and returns the last item, or none.
- list.remove(value)Removes the first matching value.
- list.remove_at(index)Removes and returns the item at an index.
- list.reverse()Reverses the list in place and returns it.
- list.size: numberNumber of items.
- list.sort()Sorts the list in place and returns it.
- livingAn entity with health.Paper
- living.ai: boolWhether the mob moves and attacks on its own.Paper
- living.clear_effects([type])Removes one potion effect, or all of them.Paper
- living.damage(amount)Deals damage.Paper
- living.effect(type, duration, [level])Gives a potion effect, e.g.Paper
- living.has_effect(type)True if the entity has that potion effect.Paper
- living.heal([amount])Heals fully, or by an amount.Paper
- living.health: numberCurrent health (20 is ten hearts).Paper
- living.is_dead: boolTrue if dead.Paper
- living.kill()Kills the entity.Paper
- living.max_health: numberMaximum health.Paper
- living.target: entityWhat a mob is attacking, or none.Paper
- loadRuns once when the script is loaded or reloaded.
- locationA position in a world.Paper
- location.add(x, y, z)A new location moved by the given amounts.Paper
- location.block: blockThe block at this position.Paper
- location.center: locationThe middle of the block this location is in.Paper
- location.distance(other)Distance to another location in the same world.Paper
- location.highest: blockThe highest solid block in this column.Paper
- location.nearby(radius)Entities within a radius of this location.Paper
- location.pitch: numberVertical rotation.Paper
- location.within(corner1, corner2)True if the location is inside the box between two corners.Paper
- location.world: worldThe world.Paper
- location.x: numberX coordinate.Paper
- location.y: numberY coordinate.Paper
- location.yaw: numberHorizontal rotation.Paper
- location.z: numberZ coordinate.Paper
- mapKeys mapped to values.
- map.clear()Removes everything.
- map.copy()A new map with the same entries.
- map.get(key, [default])Value for the key, or the default.
- map.has(key)True if the key exists.
- map.keys()List of keys.
- map.remove(key)Removes a key and returns its value.
- map.size: numberNumber of entries.
- map.values()List of values.
- mathMath functions and constants.
- math.atan2(y, x)Angle of the point (x, y) in radians.
- math.clamp(x, low, high)x limited to the range low..high.
- math.cos(radians)Cosine.
- math.degrees(radians)Radians to degrees.
- math.e2.71828...
- math.exp(x)e raised to x.
- math.lerp(a, b, t)Linear interpolation between a and b.
- math.log(x)Natural logarithm.
- math.pi3.14159...
- math.pow(base, exponent)base raised to exponent.
- math.radians(degrees)Degrees to radians.
- math.sign(x)-1, 0 or 1.
- math.sin(radians)Sine.
- math.sqrt(x)Square root.
- math.tan(radians)Tangent.
- max(...values)Largest of the values (or of a list).
- menuA chest menu from the menus module.Paper
- menu.border(item)Puts an item in every slot on the edge of the menu.Paper
- menu.button(slot, item, handler, ...args)Puts a clickable item in a slot.Paper
- menu.clear()Removes every item and button.Paper
- menu.click_sound: textSound played when a button is clicked (none for silence).Paper
- menu.close([player])Closes the menu for one player, or for everyone who has it open.Paper
- menu.column(column, item)Fills a whole column.Paper
- menu.fill(item)Fills every empty slot, e.g.Paper
- menu.inventory: inventoryThe underlying inventory.Paper
- menu.item(slot)The item in a slot, or none.Paper
- menu.locked: boolTrue (the default) stops players taking items out or putting items in.Paper
- menu.next()Shows the next page.Paper
- menu.on_close(handler, ...args)Calls handler(player, ...args) when a player closes the menu.Paper
- menu.on_open(handler, ...args)Calls handler(player, ...args) whenever the menu is opened with menu.open or player.open.Paper
- menu.open(player)Opens the menu for a player.Paper
- menu.page: numberCurrent page of a paged menu, starting at 1.Paper
- menu.page_count: numberNumber of pages of a paged menu.Paper
- menu.pages(items, [handler], ...args)Shows a list of items over as many pages as needed, with previous/next buttons in the bottom row.Paper
- menu.previous()Shows the previous page.Paper
- menu.row(row, item)Fills a whole row.Paper
- menu.rows: numberNumber of rows.Paper
- menu.set(slot, item)Puts a plain item in a slot (none empties it).Paper
- menu.size: numberNumber of slots.Paper
- menu.title: textTitle given when the menu was created.Paper
- menu.viewers: listPlayers who have this menu open.Paper
- menusChest menus with clickable buttons, pages and confirm dialogs.Paper
- menus.confirm(player, title, on_yes, ...args)Opens a yes/no dialog.Paper
- menus.create(title, [rows])Creates a menu with 1 to 6 rows (3 by default).Paper
- menus.current(player)The menu a player has open, or none.Paper
- menus.slot(row, column)Slot number for a row and column, both starting at 1.Paper
- min(...values)Smallest of the values (or of a list).
- networkMessages between Paper servers and the Velocity proxy.
- network.broadcast(channel, [data])Sends a message to every other server and the proxy.
- network.connect(player, server)Moves a player to another server.
- network.messageA message sent with the network module arrived.
- network.proxy(channel, [data])Sends a message to the Velocity proxy.
- network.send(target, channel, [data])Sends a message to a server by name, or to "proxy".
- network.server()Name of this server as the proxy knows it ("proxy" on Velocity).
- network.servers()Names of all servers registered on the proxy.
- num(value)Converts text to a number, or none if it is not a number.
- offline_playerA player who may be offline, from players.offline(name).Paper
- offline_player.ban([reason])Bans the player (and kicks them if online).Paper
- offline_player.banned: boolTrue if the player is banned.Paper
- offline_player.first_played: numberWhen the player first joined, as a time.now() value.Paper
- offline_player.has_played: boolTrue if the player has joined this server before.Paper
- offline_player.last_seen: numberWhen the player was last online, as a time.now() value.Paper
- offline_player.name: textLast known name (none if the player never joined).Paper
- offline_player.online: boolTrue if the player is on the server right now.Paper
- offline_player.op: boolWhether the player is a server operator.Paper
- offline_player.player: playerThe online player, or none.Paper
- offline_player.unban()Lifts a ban.Paper
- offline_player.uuid: textUnique id.Paper
- offline_player.whitelisted: boolWhether the player is on the whitelist.Paper
- placeholdersPlaceholderAPI: use other plugins' %placeholders% and provide your own as %flint_name%.Paper
- placeholders.available()True if PlaceholderAPI is installed.Paper
- placeholders.parse(player, text)Replaces %placeholders% of other plugins in the text.Paper
- placeholders.register(name, function, ...args)Provides %flint_<name>% to every plugin.Paper
- placeholders.unregister(name)Stops providing a placeholder.Paper
- playerAn online player.
- player.action_bar(message)Shows a message above the hotbar.
- player.advancementA player completed an advancement.Paper
- player.armor_changeA player put on or took off a piece of armour.Paper
- player.bed_enterA player is getting into a bed.Paper
- player.brand: textClient the player uses (vanilla, fabric...), if it said so.Paper
- player.bucket_emptyA player is emptying a bucket.Paper
- player.bucket_fillA player is filling a bucket.Paper
- player.can_fly: boolWhether the player may fly.Paper
- player.can_see(other)True if this player can see the other player.Paper
- player.chatA player sent a chat message.
- player.clear_effects([type])Removes one potion effect, or all of them.Paper
- player.clear_title()Removes the title from the player's screen.Paper
- player.close_inventory()Closes whatever inventory the player has open.Paper
- player.command(command)Makes the player run a command (without the slash).Paper
- player.commandA player typed a command (before it runs).
- player.compass_target: locationWhere the player's compass points.Paper
- player.connect(server)Sends the player to a backend server (a server or its name).Velocity
- player.consumeA player ate or drank something.Paper
- player.deathA player died.Paper
- player.display_name: textDisplay name.Paper
- player.dropA player dropped an item.Paper
- player.effect(type, duration, [level])Gives a potion effect, e.g.Paper
- player.exp: numberProgress to the next level, 0 to 1.Paper
- player.exp_changeA player is gaining experience points.Paper
- player.fishSomething happened while fishing.Paper
- player.fly_speed: numberFlying speed; 0.1 is normal, 1 is the maximum.Paper
- player.flying: boolWhether the player is flying.Paper
- player.food: numberFood level, 0 to 20.Paper
- player.gamemode: textsurvival, creative, adventure or spectator.Paper
- player.gamemode_changeA player's game mode is changing.Paper
- player.give(item, [amount])Gives an item (an item value or a type name such as "diamond").Paper
- player.has_effect(type)True if the player has that potion effect.Paper
- player.held_item: itemItem in the main hand (none if empty).Paper
- player.hide_from(other)Makes this player invisible to another player (vanish).Paper
- player.hungerA player's food level is changing.Paper
- player.interactA player clicked air or a block.Paper
- player.interact_entityA player right-clicked an entity.Paper
- player.inventory: inventoryThe player's inventory.Paper
- player.ip: textIP address.
- player.item_breakA player's tool or armour broke.Paper
- player.item_cooldown(type, duration)Greys out an item type in the hotbar for a while, like ender pearls.Paper
- player.item_heldA player selected another hotbar slot.Paper
- player.joinA player joined the server.
- player.jumpA player jumped.Paper
- player.kick([reason])Kicks the player.
- player.kickA player is being kicked.Paper
- player.level: numberExperience level.Paper
- player.level_changeA player's experience level changed.Paper
- player.locale: textClient language, such as en_us.
- player.loginA player is logging in to the proxy.Velocity
- player.moveA player moved or looked around.Paper
- player.name: textUsername.Velocity
- player.online: boolFalse once the player has left.
- player.op: boolWhether the player is a server operator.Paper
- player.open(inventory)Opens an inventory or a menu for the player.Paper
- player.pickupAn entity (usually a player) is picking up an item from the ground.Paper
- player.ping: numberLatency in milliseconds.
- player.portalA player is going through a portal.Paper
- player.quitA player left the server.
- player.respawnA player respawned.Paper
- player.respawn_location: locationWhere the player respawns (bed or anchor), or none.Paper
- player.saturation: numberHidden food reserve that is used up before the food bar.Paper
- player.server: serverThe backend server the player is on, or none.Velocity
- player.shearA player is shearing an entity.Paper
- player.show_to(other)Makes this player visible to another player again.Paper
- player.sneakA player started or stopped sneaking.Paper
- player.sneaking: boolWhether the player is sneaking.Paper
- player.sound(name, [volume], [pitch])Plays a sound, e.g.Paper
- player.swap_handsA player pressed the swap-hands key (F).Paper
- player.tab_name: textName shown in the player list.Paper
- player.teleportA player is being teleported.Paper
- player.title(title, [subtitle])Shows a big title.
- player.toggle_flightA player started or stopped flying.Paper
- player.total_exp: numberAll experience points the player has collected.Paper
- player.uuid: textUnique id.Velocity
- player.walk_speed: numberWalking speed; 0.2 is normal, 1 is the maximum.Paper
- player.world_changeA player arrived in another world.Paper
- playersFind online players.Paper
- players.all()List of all online players.Paper
- players.by_uuid(uuid)The online player with that unique id, or none.Paper
- players.count()Number of online players.Paper
- players.find(name)The online player with that name, or none.Paper
- players.offline(name)A player by name, online or not.Paper
- print(...values)Writes values to the server console.
- projectile.hitA projectile hit a block or an entity.Paper
- proxyThe Velocity proxy: players, servers, console commands.Velocity
- proxy.by_uuid(uuid)The online player with that unique id, or none.Velocity
- proxy.command(command)Runs a proxy command as the console (without the slash).Velocity
- proxy.count()Number of players connected to the proxy.Velocity
- proxy.find(name)The online player with that name, or none.Velocity
- proxy.players()All players connected to the proxy.Velocity
- proxy.server(name)The server with that name, or none.Velocity
- proxy.servers()All registered backend servers.Velocity
- proxy.version()Velocity version.Velocity
- randomRandom numbers and choices.
- random.chance(percent)True with the given probability, e.g.
- random.choice(list)A random item of a list, or none if it is empty.
- random.float([min], [max])Random decimal number (0 to 1 by default).
- random.int(min, max)Random whole number from min to max, both included.
- random.shuffle(list)A shuffled copy of a list.
- random.uuid()A random UUID as text.
- range(start_or_end, [end], [step])A list of numbers: range(3) is [0, 1, 2], range(1, 4) is [1, 2, 3].
- recipesCustom crafting and furnace recipes.Paper
- recipes.furnace(name, result, input, [xp], [duration])A furnace recipe.Paper
- recipes.names()Names of the recipes scripts have added.Paper
- recipes.remove(name)Removes a recipe added by a script.Paper
- recipes.shaped(name, result, rows, ingredients)A crafting-table recipe.Paper
- recipes.shapeless(name, result, ingredients)A recipe where the position of the ingredients does not matter.Paper
- regexRegular expressions: match, find, replace and split text.
- regex.contains(text, pattern)True if the pattern occurs anywhere in the text.
- regex.escape(text)A pattern that matches the text literally.
- regex.find(text, pattern)The first match, or none.
- regex.find_all(text, pattern)Every match, as a list.
- regex.groups(text, pattern)The (bracketed) groups of the first match as a list, or none if nothing matches.
- regex.matches(text, pattern)True if the whole text matches the pattern.
- regex.replace(text, pattern, replacement)Replaces every match.
- regex.split(text, pattern)Splits the text wherever the pattern matches.
- round(number, [digits])Rounds to the nearest whole number, or to a number of decimals.
- schedulerRun functions later or in the background.
- scheduler.later(delay, function, ...args)Runs a function after a delay; the caller continues immediately.
- scheduler.run(function, ...args)Starts a function on its own; the caller continues immediately.
- senderWhoever ran a command: a player or the console.
- sender.has_permission(permission)True if the sender has the permission.
- sender.is_console: boolTrue if the sender is the console.
- sender.is_player: boolTrue if the sender is a player.
- sender.name: textName of the sender.
- sender.send(message)Sends a message.
- serverThe server itself: console commands, version, TPS.Paper
- serverA backend server registered on the proxy.Velocity
- server.address: textHost and port.Velocity
- server.command(command)Runs a command as the console (without the slash).Paper
- server.commandThe console (or a command block) is running a command.Paper
- server.connectA player is about to connect to a backend server.Velocity
- server.connectedA player connected to a backend server.Velocity
- server.has_plugin(name)True if a plugin with that name is installed and enabled.Paper
- server.kickA player was kicked from a backend server.Velocity
- server.max_players()Maximum number of players.Paper
- server.motd()The message shown in the server list.Paper
- server.name: textName of the server.Velocity
- server.pingSomeone refreshed the server list.Paper
- server.player_count: numberNumber of players on this server.Velocity
- server.players: listPlayers connected to this server.Velocity
- server.plugins()Names of the enabled plugins.Paper
- server.send(message)Sends a chat message to everyone on this server.Velocity
- server.tps()Ticks per second over the last minute (20 is perfect).Paper
- server.version()Minecraft version of the server.Paper
- server.whitelist([enabled])Whether the whitelist is on; pass true or false to switch it.Paper
- sidebarA per-player panel on the right of the screen (scoreboard sidebar).Paper
- sidebar.hide(player)Removes the player's sidebar.Paper
- sidebar.show(player, title, lines)Shows or updates the player's sidebar.Paper
- sidebar.visible(player)True if the player has a Flint sidebar.Paper
- sign.changeA player finished writing a sign.Paper
- storageSimple key/value storage shared by all scripts (and by all servers when storage.type=database).
- storage.add(key, amount)Adds a number to a stored number and returns the new value.
- storage.delete(key)Deletes a key.
- storage.fetch(key)Reads the latest value straight from the backend (use when another server may have changed it).
- storage.get(key, [default])Stored value for a key, or the default.
- storage.has(key)True if the key is stored.
- storage.keys([prefix])All stored keys, optionally only those starting with a prefix.
- storage.save()Writes pending changes now instead of waiting for the autosave.
- storage.set(key, value)Stores a value (none deletes the key).
- str(value)Converts a value to text.
- sum(list)Total of a list of numbers.
- textFormatted text (MiniMessage, legacy colour codes).
- textA piece of text.
- text.contains(part)True if the text contains the part.
- text.ends_with(suffix)True if the text ends with the suffix.
- text.escape(text)Escapes MiniMessage tags.
- text.index_of(part)Position of the part, or -1.
- text.join(...parts)Joins formatted and plain parts into one formatted text.
- text.legacy(text)Parses legacy colour codes such as &a into formatted text.
- text.length: numberNumber of characters.
- text.literal(value)Formatted text that shows the value exactly, with no tags parsed.
- text.lower()Lower-case copy.
- text.mini(text)Parses MiniMessage tags such as <green> or <bold> into formatted text.
- text.plain(value)Unformatted text of a value.
- text.plain_of(formatted)Plain text of a formatted value.
- text.repeat(times)The text repeated.
- text.replace(old, new)Copy with every occurrence replaced.
- text.split([separator])Splits into a list (on spaces by default).
- text.starts_with(prefix)True if the text starts with the prefix.
- text.strip(text)Removes MiniMessage tags.
- text.sub(start, [end])Part of the text from start (inclusive) to end (exclusive).
- text.to_mini(formatted)MiniMessage text for a formatted value.
- text.trim()Copy without leading and trailing spaces.
- text.upper()Upper-case copy.
- timeClock, dates and durations.
- time.date()Today's date as yyyy-MM-dd.
- time.format([pattern], [timestamp])Formats a time (default now), e.g.
- time.hours(n)A duration of n hours.
- time.millis()Current time in milliseconds since 1970.
- time.minutes(n)A duration of n minutes.
- time.now()Current time in seconds since 1970 (Unix time).
- time.pretty(seconds)Human readable length, e.g.
- time.seconds(n)A duration of n seconds.
- time.since(timestamp)Seconds elapsed since a time.now() value.
- time.ticks(n)A duration of n game ticks.
- transactionAn open transaction from database.begin().
- transaction.commit()Saves all changes made in the transaction.
- transaction.execute(sql, [params])Runs a statement inside the transaction.
- transaction.first(sql, [params])Runs a SELECT inside the transaction and returns the first row, or none.
- transaction.query(sql, [params])Runs a SELECT inside the transaction.
- transaction.rollback()Discards all changes made in the transaction.
- type(value)Name of a value's type, such as "number", "text" or "player".
- unloadRuns when the script is unloaded or the server stops.
- vehicle.enterAn entity is getting into a boat, minecart or onto a mount.Paper
- vehicle.exitAn entity is leaving a vehicle.Paper
- weather.changeRain is starting or stopping in a world.Paper
- worldA world (dimension).Paper
- world.block(x, y, z)The block at the coordinates.Paper
- world.blocks(corner1, corner2)Every block in the box between two corners (at most 100000).Paper
- world.difficulty: textpeaceful, easy, normal or hard.Paper
- world.drop(location, item, [amount])Drops an item on the ground and returns the item entity.Paper
- world.entities: listEvery loaded entity in the world.Paper
- world.explode(location, power, [break_blocks], [fire])Creates an explosion (TNT is power 4).Paper
- world.gamerule(name, [value])Reads a game rule, or sets it when a value is given: world.gamerule("keepInventory", true).Paper
- world.highest(x, z)The highest solid block at the coordinates.Paper
- world.lightning(location, [harmless])Strikes lightning.Paper
- world.loadA world finished loading.Paper
- world.location(x, y, z, [yaw], [pitch])A location in this world.Paper
- world.name: textName of the world.Paper
- world.particle(type, location, [count], [spread])Shows particles, e.g.Paper
- world.players: listPlayers in this world.Paper
- world.pvp: boolWhether players can hurt each other.Paper
- world.seed: textThe world seed.Paper
- world.sound(location, name, [volume], [pitch])Plays a sound everyone nearby can hear.Paper
- world.spawn: locationSpawn location.Paper
- world.storming: boolWhether it is raining.Paper
- world.time: numberTime of day in ticks (0 to 24000).Paper
- worldsWorlds and locations.Paper
- worlds.all()List of loaded worlds.Paper
- worlds.get(name)The world with that name, or none.Paper
- worlds.location(world, x, y, z, [yaw], [pitch])Creates a location.Paper
- worlds.main()The main (first) world.Paper
No entries match.