### examples(String... examples) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/classes/ClassInfo.html Sets example usages for this class, used for Skript's documentation. ```APIDOC ## examples(String... examples) ### Description Only used for Skript's documentation. ### Method Signature `ClassInfo examples(String... examples)` ``` -------------------------------- ### Sign Text Examples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprSignText.html Examples demonstrating how to get and set lines of text on a sign. Note the 16-character limit per line and that color codes count as two characters. ```skript on rightclick on sign: line 2 of the clicked block is "[Heal]": heal the player set line 3 to "%player%" ``` -------------------------------- ### Starts/Ends With Condition Example Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/conditions/CondStartsEndsWith.html This example demonstrates how to check if a text starts with specific strings. It uses the 'if the argument starts with' syntax and can check against multiple strings separated by 'or'. ```Skript if the argument starts with "test" or "debug": send "Stop!" ``` -------------------------------- ### examples() Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/lang/SkriptEventInfo.ModernSkriptEventInfo.html Retrieves a collection of strings representing examples for using a Skript syntax. This method is deprecated and scheduled for removal. ```APIDOC ## examples() ### Description Retrieves examples for using a Skript syntax. ### Method `examples()` ### Returns `Collection` - Documentation data. Examples for using a syntax. ### Deprecated This API element is subject to removal in a future version. ``` -------------------------------- ### Vector XYZ Component Examples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprVectorXYZ.html Demonstrates setting a vector, retrieving its components, and modifying them. Use 'x of', 'y of', 'z of' to get components and 'add ... to x of' to modify them. ```skript set {_v} to vector 1, 2, 3 send "%x of {_v}%, %y of {_v}%, %z of {_v}%" add 1 to x of {_v} add 2 to y of {_v} add 3 to z of {_v} send "%x of {_v}%, %y of {_v}%, %z of {_v}%" ``` ```skript set x component of {_v} to 1 set y component of {_v} to 2 set z component of {_v} to 3 send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%" ``` -------------------------------- ### addExample(String example) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/registration/BukkitSyntaxInfos.Event.Builder.html Adds an example to the event's documentation. ```APIDOC ## addExample(String example) ### Description Adds an example to the event's documentation. ### Method N/A (Java method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### BukkitSyntaxInfos.Event.Builder.addExample Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Adds a single example string to the event's documentation. Examples help users understand how to use the event. ```APIDOC ## addExample(String) ### Description Adds an example to the event's documentation. ### Method Method signature: `addExample(String)` ### Parameters * **example** (String) - The example string to add. ``` -------------------------------- ### Collection examples() Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/registration/BukkitSyntaxInfos.Event.html Retrieves a collection of example strings demonstrating the usage of the syntax. ```APIDOC ## examples ### Description Returns a collection of example strings demonstrating the usage of the syntax. ### Method Signature `Collection examples()` ### Returns A `Collection` of strings, where each string is an example of syntax usage. ``` -------------------------------- ### BukkitSyntaxInfos.Event.Builder.addExamples (String...) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Adds multiple example strings to the event's documentation using varargs. This is useful for providing several examples concisely. ```APIDOC ## addExamples(String...) ### Description Adds examples to the event's documentation. ### Method Method signature: `addExamples(String...)` ### Parameters * **examples** (String...) - A variable number of example strings to add. ``` -------------------------------- ### Make Equippable Component Swappable Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/CondEquipCompSwapEquipment.html This example shows how to get the equippable component of an item and then make it swappable if it's not already set to be swappable when right-clicked. ```skript set {_component} to the equippable component of {_item} if {_component} can not be equipped when right clicked: make {_component} swappable ``` -------------------------------- ### examples Method Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/lang/SkriptEventInfo.html Sets the example usage for this event, used for Skript's documentation. ```APIDOC ## examples Method ### Description Sets example usages for this event. This information is utilized by Skript for documentation purposes. ### Signature `public SkriptEventInfo examples(String... examples)` ### Parameters * `examples` (String...) - The examples for the event. ### Returns This SkriptEventInfo object. ``` -------------------------------- ### start() Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/log/TestingLogHandler.html Starts the TestingLogHandler, preparing it to receive and process log messages. ```APIDOC ## start() ### Description Initializes and starts the log handler. This method should be called before any logging operations are expected. ### Method Signature `public void start()` ``` -------------------------------- ### addExamples(String... examples) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/registration/BukkitSyntaxInfos.Event.Builder.html Adds examples to the event's documentation. ```APIDOC ## addExamples(String... examples) ### Description Adds examples to the event's documentation. ### Method N/A (Java method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### Setting Function Examples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/common/function/DefaultFunction.Builder.html Provides usage examples to demonstrate how the function can be called. ```APIDOC ## examples ### Description Sets this function builder's examples. ### Parameters - **examples** (String...) - The examples. ### Returns This builder. ``` -------------------------------- ### addExamples(Collection examples) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/registration/BukkitSyntaxInfos.Event.Builder.html Adds examples to the event's documentation. ```APIDOC ## addExamples(Collection examples) ### Description Adds examples to the event's documentation. ### Method N/A (Java method) ### Parameters #### Path Parameters N/A #### Query Parameters N/A #### Request Body N/A ### Request Example N/A ### Response #### Success Response (200) N/A #### Response Example N/A ``` -------------------------------- ### BukkitSyntaxInfos.Event.Builder.addExamples (Collection) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Adds multiple example strings to the event's documentation from a collection. This overload offers flexibility in how examples are provided. ```APIDOC ## addExamples(Collection) ### Description Adds examples to the event's documentation. ### Method Method signature: `addExamples(Collection)` ### Parameters * **examples** (Collection) - A collection of example strings to add. ``` -------------------------------- ### start() Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/log/runtime/RuntimeErrorCatcher.html Starts the RuntimeErrorCatcher, managing RuntimeErrorConsumers. ```APIDOC ## start() ### Description Starts this [`RuntimeErrorCatcher`](RuntimeErrorCatcher.html "class in org.skriptlang.skript.log.runtime"), removing all [`RuntimeErrorConsumer`](RuntimeErrorConsumer.html "interface in org.skriptlang.skript.log.runtime")s from [`RuntimeErrorManager`](RuntimeErrorManager.html "class in org.skriptlang.skript.log.runtime") and storing them in `storedConsumers`. ### Method `start()` ``` -------------------------------- ### Raw String Description Example Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/text/elements/expressions/ExprRawString.html This example shows how the raw string expression is described, including its behavior of returning the string without formatting and an example of its usage. ```skript raw "&aHello There!" ``` -------------------------------- ### examples() Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/lang/function/JavaFunction.html Retrieves a list of strings representing examples for the function. This method is deprecated. ```APIDOC ## examples() ### Description Retrieves a list of strings representing examples for the function. This method is deprecated and subject to removal in a future version. ### Returns * List - A list of strings providing examples for the function. ``` -------------------------------- ### start Method Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/log/FilteringLogHandler.html Starts the log handler. ```APIDOC ## start() ### Description Starts the log handler. This method is typically called when the logging system is initialized. ### Method `public void start()` ``` -------------------------------- ### start Method Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/log/FilteringLogHandler.html Starts the log handler, returning the implementing class instance. ```APIDOC ## start Method ### Description Starts the log handler. This is a convenience method for `SkriptLogger.startLogHandler(LogHandler)` and implementations should override this to set the return type to the implementing class. ### Signature `public FilteringLogHandler start()` ### Returns * (FilteringLogHandler) - The instance of the `FilteringLogHandler`. ``` -------------------------------- ### Example Usage for Entity Initialization Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/entity/EndermanData.html Demonstrates how to use the init method to spawn an entity and then set its properties. This example shows spawning a pig and then using the event-entity to spawn another. ```skript spawn a pig at location(0, 0, 0): set {_entity} to event-entity spawn {_entity} at location(0, 0, 0) ``` -------------------------------- ### Get Player Protocol Version Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprPlayerProtocolVersion.html This example shows how to retrieve and display the protocol version of a player. Ensure Paper 1.12.2 or newer is installed. ```skript command /protocolversion : trigger: send "Protocol version of %arg-1%: %protocol version of arg-1%" ``` -------------------------------- ### examples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/lang/function/JavaFunction.html Sets the examples for the JavaFunction, used for Skript's documentation. This method is deprecated. ```APIDOC ## examples ### Description Sets the examples for the JavaFunction. This is primarily used for Skript's documentation purposes. This method is deprecated and subject to removal. ### Parameters * `examples` - A variable number of strings representing the function's examples. ### Returns This JavaFunction object. ``` -------------------------------- ### Get Enchantment Level of Item Source: https://github.com/skriptlang/skript-docs/blob/main/docs/docs.html This example demonstrates how to get the level of a specific enchantment on a player's tool. ```skript player's tool is a sword of sharpness: message "You have a sword of sharpness %level of sharpness of the player's tool% equipped" ``` -------------------------------- ### Example Usage of Entity Data Initialization and Matching Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/entity/CatData.html Demonstrates spawning an entity and then checking if it matches specific entity data. This example shows how to use event-entity and conditional checks. ```skript spawn a pig at location(0, 0, 0): set {_entity} to event-entity spawn {_entity} at location(0, 0, 0) ``` ```skript spawn a pig at location(0, 0, 0): set {_entity} to event-entity if {_entity} is a pig: # will pass if {_entity} is a saddled pig: # will not pass ``` -------------------------------- ### Get Enchantment Level Example Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprEnchantmentLevel.html This example shows how to retrieve the level of a specific enchantment on an item. It uses the 'level of [enchantment] of [item]' syntax. ```skript player's tool is a sword of sharpness: message "You have a sword of sharpness %level of sharpness of the player\'s tool% equipped" ``` -------------------------------- ### getExamples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/classes/ClassInfo.html Retrieves example usage strings for this class. ```APIDOC ## getExamples ### Description Gets an array of strings providing examples of how to use this class. This is typically used for in-game documentation. ### Method ```java String[] getExamples() ``` ``` -------------------------------- ### Get Middle of Location Example Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprMiddleOfLocation.html This example demonstrates how to teleport a player to the center of their current location. It uses the 'middle of' expression to find the center coordinates. ```skript command /stuck: executable by: players trigger: teleport player to the middle of player's location send "You're no longer stuck." ``` -------------------------------- ### Example Usage of OcelotData Initialization Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/entity/OcelotData.html Demonstrates how to use the init method with an entity class or instance. This example shows spawning an entity and then spawning a copy of it. ```skript spawn a pig at location(0, 0, 0): set {_entity} to event-entity spawn {_entity} at location(0, 0, 0) ``` -------------------------------- ### Random Expression Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprRandom.html The ExprRandom expression is used to get a random item out of a set. For example, you can get a random player from all online players or a random item from a list of items. ```APIDOC ## Random Expression ### Description Gets a random item out of a set, e.g. a random player out of all players online. ### Examples - give a diamond to a random player out of all players - give a random item out of all items to the player ### Since 1.4.9 ``` -------------------------------- ### examples(String...) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/lang/function/JavaFunction.html Sets the examples for the function using a variable number of string arguments. This method is deprecated. ```APIDOC ## examples(String...) ### Description Sets the examples for the function using a variable number of string arguments. This method is deprecated and subject to removal in a future version. It is only used for Skript's documentation. ### Parameters * **examples** (String...) - A variable number of strings to set as the function's examples. ``` -------------------------------- ### Get Book Title in Skript Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprBookTitle.html This example shows how to get the title of a book within a Skript script. It is typically used in events related to books, such as 'on book sign'. ```skript on book sign: message "Book Title: %title of event-item%" ``` -------------------------------- ### start(String) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts a timing measurement with the given name. ```APIDOC ## start(String name) ### Description Starts a timing measurement with the given name. ### Method Static method ### Endpoint N/A (Java Method) ### Parameters * **name** (String) - The name of the timing measurement. ### Request Example N/A ### Response N/A ``` -------------------------------- ### Spectator Target Expression Examples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprSpectatorTarget.html These examples demonstrate how to use the spectator target expression in Skript. The first example shows how to display the number of kills of the spectator target when a player starts spectating. The second example logs the previous spectator target when spectating stops and sets the spectator target to the nearest skeleton. ```skript on player start spectating of player: message "%spectator target% currently has %{game::kills::%spectator target%}% kills!" to the player ``` ```skript on player stop spectating: past spectator target was a zombie set spectator target to the nearest skeleton ``` -------------------------------- ### Blank Equippable Component Example Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/itemcomponents/equippable/elements/ExprSecBlankEquipComp.html This example demonstrates how to create and configure a blank equippable component. It sets various properties such as camera overlay, allowed entities, sounds, model ID, equipment slot, and allows specific interactions like damage, dispensing, equipping, shearing, and swapping. This component can then be applied to an item. ```skript set {_component} to a blank equippable component: set the camera overlay to "custom_overlay" set the allowed entities to a zombie and a skeleton set the equip sound to "block.note_block.pling" set the equipped model id to "custom_model" set the shear sound to "ui.toast.in" set the equipment slot to chest slot allow event-equippable component to be damage when hurt allow event-equippable component to be dispensed allow event-equippable component to be equipped onto entities allow event-equippable component to be sheared off allow event-equippable component swap equipment set the equippable component of {_item} to {_component} ``` -------------------------------- ### ChickenData Initialization Example Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/entity/ChickenData.html Example usage for initializing and spawning entities with specific data in Skript. ```Skript spawn a pig at location(0, 0, 0):\n set {_entity} to event-entity\nspawn {_entity} at location(0, 0, 0) ``` -------------------------------- ### start Method Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/log/RedirectingLogHandler.html Starts the log handler, returning the handler itself for convenience. ```APIDOC ## start Method ### Description A convenience method for `SkriptLogger.startLogHandler(LogHandler)`. Implementations should override this to set the return type to the implementing class. This method overrides the `start` method from the `LogHandler` class. ### Method `public RedirectingLogHandler start()` ### Returns `RedirectingLogHandler` - The started log handler instance. ``` -------------------------------- ### addExample (String) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/registration/BukkitSyntaxInfos.Event.Builder.html Adds a single example to the event's documentation. This method is part of a fluent builder pattern, returning the builder instance for chaining. ```APIDOC ## addExample (String) ### Description Adds an example to the event's documentation. ### Method Builder method (fluent interface) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **example** (String) - The example to add. ### Request Example ```java BukkitSyntaxInfos.Event.Builder builder = ...; builder.addExample("This is an example."); ``` ### Response #### Success Response Returns the current builder instance for chaining. #### Response Example ```java // Returns the builder instance ``` ``` -------------------------------- ### Skript: Spawn and get event entity Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/entity/EntityData.html Example of spawning an entity and then retrieving it as the event-entity for further use. ```skript spawn a pig at location(0, 0, 0): set {_entity} to event-entity spawn {_entity} at location(0, 0, 0) ``` -------------------------------- ### Book Author Expression Example Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprBookAuthor.html This example shows how to use the 'author of' expression to get the author's name from a book. It is typically used in event handlers like 'on book sign'. ```skript on book sign: message "Book Title: %author of event-item%" ``` -------------------------------- ### addExamples (String...) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/registration/BukkitSyntaxInfos.Event.Builder.html Adds multiple examples to the event's documentation. This method accepts a variable number of String arguments and returns the builder instance for chaining. ```APIDOC ## addExamples (String...) ### Description Adds examples to the event's documentation. ### Method Builder method (fluent interface) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **examples** (String...) - The examples to add. ### Request Example ```java BukkitSyntaxInfos.Event.Builder builder = ...; builder.addExamples("Example 1", "Example 2"); ``` ### Response #### Success Response Returns the current builder instance for chaining. #### Response Example ```java // Returns the builder instance ``` ``` -------------------------------- ### Moon Phase Expression Example Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprMoonPhase.html This example shows how to check the current moon phase in Skript. It requires Paper 1.16+ and uses the 'moon phase' expression to get the phase of the player's world. ```skript if moon phase of player\'s world is full moon: send \ ``` -------------------------------- ### Get Elements within a Range Source: https://github.com/skriptlang/skript-docs/blob/main/docs/docs.html Extracts a range of elements from a list or queue, specified by start and end indices. ```skript set {page2::*} to elements from 11 to 20 of {top players::*} ``` -------------------------------- ### Get Event Region Source: https://github.com/skriptlang/skript-docs/blob/main/docs/expressions.html Retrieves the region associated with an event. This expression requires a supported regions plugin to be installed. ```skript [the] [event-]region ``` -------------------------------- ### init Method Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/LitConsole.html Initializes the LitConsole instance after construction, processing parsed Skript syntax. ```APIDOC ## init ### Description Called just after the constructor. This method is responsible for initializing the syntax element based on parsed Skript code. ### Method Signature ```java public boolean init(Expression[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult) ``` ### Parameters - **exprs** (Expression[]) - An array of Skript expressions used in the syntax. - **matchedPattern** (int) - The index of the matched Skript pattern. - **isDelayed** (Kleenean) - A boolean indicating if the syntax is delayed. - **parseResult** (SkriptParser.ParseResult) - The result of parsing the Skript syntax. ``` -------------------------------- ### Get Blocks in Region Source: https://github.com/skriptlang/skript-docs/blob/main/docs/expressions.html Retrieves all blocks within a defined region. Requires a supported regions plugin to be installed. ```skript loop all blocks in the region {arena.%{faction.%player%}%}: clear the loop-block ``` -------------------------------- ### Skript Options Example Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/structures/StructOptions.html Demonstrates how to define and use options in Skript for dynamic content replacement. Options are declared at the top of the script and can be referenced using the {@option_name} syntax. ```skript options: \tno_permission: You\'re missing the required permission to execute this command! command /ping: \tpermission: command.ping \tpermission message: {@no_permission} \ttrigger: \t\tmessage "Pong!" command /pong: \tpermission: command.pong \tpermission message: {@no_permission} \ttrigger: \t\tmessage "Ping!" ``` -------------------------------- ### Get Regions At Location Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/hooks/regions/expressions/ExprRegionsAt.html This expression retrieves all regions at a particular location. It requires a supported regions plugin to be installed. ```java public class ExprRegionsAt extends SimpleExpression { @Name("Regions At") @Description({"All regions at a particular location.", "This expression requires a supported regions plugin to be installed."}) @Examples({"On click on a sign:\n\tline 1 of the clicked block is \"[region info]\"\n\tset {_regions::*} to regions at the clicked block\n\tif {_regions::*} is empty:\n\t\tmessage \"No regions exist at this sign.\"\n\telse:\n\t\tmessage \"Regions containing this sign: %{_regions::*}%.\""}) @Since("2.1") @RequiredPlugins("Supported regions plugin") public class ExprRegionsAt extends SimpleExpression { // ... constructors and other methods } } ``` -------------------------------- ### Java - Get Chicken Entity Type Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/entity/ChickenData.html Returns the Class object representing the entity type handled by this EntityData. For example, Pig.class. ```java public Class getType() ``` -------------------------------- ### init Method Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/structures/StructCommand.html Initializes the command with parsed arguments and context. ```APIDOC ## init Method ### Description This method is responsible for initializing the command structure with the provided arguments, matched pattern, parse result, and entry container. ### Signature `public boolean init(Literal[] args, int matchedPattern, SkriptParser.ParseResult parseResult, EntryContainer entryContainer)` ### Parameters * **args** (`Literal[]`) - An array of literals representing the arguments. * **matchedPattern** (`int`) - The index of the matched pattern. * **parseResult** (`SkriptParser.ParseResult`) - The result of parsing the Skript code. * **entryContainer** (`EntryContainer`) - The container for the entry. ``` -------------------------------- ### start() - RedirectingLogHandler Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts the RedirectingLogHandler. This method is part of the logging utility in Skript. ```APIDOC ## start() ### Description Starts the RedirectingLogHandler. ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### EvtBrewingStart Class Methods Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/brewing/elements/events/EvtBrewingStart.html This section outlines the key methods available for the EvtBrewingStart event, including registration, initialization, checking event applicability, and string representation. ```APIDOC ## EvtBrewingStart ### Description Represents an event that is triggered when a brewing process starts in Minecraft. This class extends `SkriptEvent` and provides methods for handling and checking brewing-related events within Skript. ### Methods #### `register(SyntaxRegistry)` * **Description**: Registers the `EvtBrewingStart` event with the Skript syntax registry. * **Signature**: `public static void register(SyntaxRegistry registry)` #### `init(Literal[], int, SkriptParser.ParseResult)` * **Description**: Initializes the event based on parsed Skript syntax. * **Signature**: `public boolean init(Literal[] literals, int matchedPattern, SkriptParser.ParseResult parseResult)` #### `check(Event)` * **Description**: Checks if the given Bukkit `Event` applies to this Skript event. * **Signature**: `public boolean check(Event event)` #### `toString(Event, boolean)` * **Description**: Returns a string representation of the event, useful for debugging. * **Signature**: `public String toString(Event event, boolean debug)` ``` -------------------------------- ### Get Damage Location of Damage Source in Skript Source: https://github.com/skriptlang/skript-docs/blob/main/docs/docs.html This example demonstrates how to get the location from which the damage originated. It's particularly useful for custom damage sources or when an entity didn't directly cause the damage. Requires Skript version 2.12 or later. ```skript damage all players by 5 using a custom damage source: set the damage type to magic set the causing entity to {\_player} set the direct entity to {\_arrow} set the damage location to location(0, 0, 10) on death: set {\_location} to the damage location of event-damage source ``` -------------------------------- ### start() - RuntimeErrorCatcher Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts this RuntimeErrorCatcher, removing all RuntimeErrorConsumers from RuntimeErrorManager and storing them. ```APIDOC ## start() ### Description Starts this [`RuntimeErrorCatcher`](org/skriptlang/skript/log/runtime/RuntimeErrorCatcher.html "class in org.skriptlang.skript.log.runtime"), removing all [`RuntimeErrorConsumer`](org/skriptlang/skript/log/runtime/RuntimeErrorConsumer.html "interface in org.skriptlang.skript.log.runtime")s from [`RuntimeErrorManager`](org/skriptlang/skript/log/runtime/RuntimeErrorManager.html "class in org.skriptlang.skript.log.runtime") and storing them in `RuntimeErrorCatcher.storedConsumers`. ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Skript Example: Spawning and Setting Entity Data Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/entity/SimpleEntityData.html Demonstrates spawning an entity and then setting specific data to it using Skript syntax. This example shows how to capture an event entity and then spawn a similar entity with the same data. ```skript spawn a pig at location(0, 0, 0): set {_entity} to event-entity spawn {_entity} at location(0, 0, 0) ``` -------------------------------- ### Get Player Location Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprLocationOf.html This example shows how to store the player's current location into a variable. The location includes coordinates, world, and direction. ```skript set {home::%uuid of player%} to the location of the player ``` -------------------------------- ### start() - TimingLogHandler Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts the TimingLogHandler. This method is part of the logging utility in Skript. ```APIDOC ## start() ### Description Starts the TimingLogHandler. ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### start() - RetainingLogHandler Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts the RetainingLogHandler. This method is part of the logging utility in Skript. ```APIDOC ## start() ### Description Starts the RetainingLogHandler. ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get Biome at Player Location Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprBiome.html This example demonstrates how to check if a player is in a desert biome and apply damage if they are. It loops through all players every minute. ```skript every real minute: loop all players: biome at loop-player is desert damage the loop-player by 1 ``` -------------------------------- ### start() - ParseLogHandler Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts the ParseLogHandler. This method is part of the logging utility in Skript. ```APIDOC ## start() ### Description Starts the ParseLogHandler. ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get the number of players online Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprAmount.html This example shows how to use the 'number of all players' expression to display the total number of players currently online. ```skript message "There are %number of all players% players online!" ``` -------------------------------- ### Experience Manipulation Examples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprExperience.html These examples demonstrate how to use ExprExperience to modify experience in different event contexts. They cover adding to spawned experience, clearing dropped experience, and conditionally adding experience based on player tools. ```skript on experience spawn: add 5 to the spawned experience ``` ```skript on break of coal ore: clear dropped experience ``` ```skript on break of diamond ore: if tool of player = diamond pickaxe: add 100 to dropped experience ``` -------------------------------- ### WXYZ Component/Coordinate Examples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/common/properties/expressions/PropExprWXYZ.html Demonstrates getting and setting W, X, Y, and Z components for vectors and player properties. The W axis is only used for quaternions. ```skript set {_v} to vector(1, 2, 3) send "%x of {_v}%, %y of {_v}%, %z of {_v}%" add 1 to x of {_v} add 2 to y of {_v} add 3 to z of {_v} send "%x of {_v}%, %y of {_v}%, %z of {_v}%" set x component of {_v} to 1 set y component of {_v} to 2 set z component of {_v} to 3 send "%x component of {_v}%, %y component of {_v}%, %z component of {_v}%" ``` ```skript set {_x} to x of player set {_z} to z of player if: {_x} is between 0 and 100 {_z} is between 0 and 100 then: set y component of player's velocity to 10 ``` -------------------------------- ### init (with parameters) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/lang/util/SimpleLiteral.html Called just after the constructor and preInit, with detailed parsing information. ```APIDOC ## init ### Description Called just after the constructor and [`SyntaxElement.preInit()`](../SyntaxElement.html#preInit fected). ### Method init ### Parameters #### Path Parameters - **expressions** (Expression[]) - Required - The expressions involved. - **matchedPattern** (int) - Required - The index of the matched pattern. - **isDelayed** (Kleenean) - Required - Whether the initialization is delayed. - **parseResult** (SkriptParser.ParseResult) - Required - The result of the parsing. ### Return Type boolean ``` -------------------------------- ### start() - CountingLogHandler Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts the CountingLogHandler. This method is part of the logging utility in Skript. ```APIDOC ## start() ### Description Starts the CountingLogHandler. ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Create and Configure Boss Bar Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/bossbar/elements/expressions/ExprSecCreateBossBar.html This example demonstrates how to create a boss bar, set its color, title, progress, and style, and manage its viewers. It also shows how to make the boss bar persistent. ```skript on join: set {_bar} to a boss bar: set color of event-bossbar to white set title of event-bossbar to "Welcome %player%!" set progress of event-bossbar to 50% set style of event-bossbar to 6 notches make event-bossbar darken the sky add player to viewers of {_bar} wait 5 seconds remove player from viewers of {_bar} ``` -------------------------------- ### Enchantment Level Expression Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprEnchantmentLevel.html Retrieves the level of a specific enchantment on an item. This expression is used to get the current level of an enchantment, for example, 'sharpness' on a sword. ```APIDOC ## Enchantment Level Expression ### Description Retrieves the level of a specific enchantment on an item. This expression is used to get the current level of an enchantment, for example, 'sharpness' on a sword. ### Syntax - `level of of ` ### Parameters - **enchantment**: The enchantment to check (e.g., sharpness, unbreaking). - **item**: The item to check the enchantment on. ### Return Type - `Long`: The level of the enchantment. ### Example ```skript player's tool is a sword of sharpness: message "You have a sword of sharpness %level of sharpness of the player's tool% equipped" ``` ### Annotations - `@Name("Enchantment Level")` - `@Description("The level of a particular enchantment on an item.")` - `@Since("2.0")` ``` -------------------------------- ### Start and Use LogHandler in Java Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/log/SkriptLogger.html Demonstrates the recommended way to start and use a LogHandler within a try-with-resources block. This ensures the handler is properly managed and closed. ```java try (LogHandler handler = SkriptLogger.startLogHandler(new ...LogHandler())) { doSomethingThatLogsMessages(); // do something with the logged messages } ``` -------------------------------- ### start() - BlockingLogHandler Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts the BlockingLogHandler. This method is part of the logging utility in Skript. ```APIDOC ## start() ### Description Starts the BlockingLogHandler. ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### start() - LogHandler Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts a log handler. This is a convenience method for SkriptLogger.startLogHandler(LogHandler). ```APIDOC ## start() ### Description Starts a log handler. This is a convenience method for [`SkriptLogger.startLogHandler(LogHandler)`](ch/njol/skript/log/SkriptLogger.html#startLogHandler\(T\)). ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Brewing Stand Fuel Level Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/brewing/elements/ExprBrewingFuelLevel.html Allows getting and setting the fuel level of a brewing stand. The fuel level decreases by one at the start of brewing each potion. ```APIDOC ## Brewing Stand Fuel Level ### Description This expression allows you to get or set the fuel level of a brewing stand. The fuel level is an integer representing the amount of fuel remaining. Each potion brewed consumes one unit of fuel at the start of the brewing process. ### Usage - Get fuel level: `set {_fuel} to the brewing stand fuel level of {_block}` - Set fuel level: `set the brewing stand fuel level of {_block} to 10` - Clear fuel level: `clear the brewing stand fuel level of {_block}` ### Parameters - `_block`: The brewing stand block whose fuel level is being accessed. ``` -------------------------------- ### EvtBrewingStart Constructor Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/brewing/elements/EvtBrewingStart.html Initializes a new instance of the EvtBrewingStart class. ```APIDOC ## EvtBrewingStart() ### Description Initializes a new instance of the EvtBrewingStart class. ### Constructor EvtBrewingStart() ``` -------------------------------- ### start() - FilteringLogHandler Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts the FilteringLogHandler. This method is part of the logging utility in Skript. ```APIDOC ## start() ### Description Starts the FilteringLogHandler. ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Get and Set Color of Block Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/misc/elements/expressions/ExprColorOf.html This example demonstrates how to retrieve the color of a wool block and then set its color to black. It checks if the event block is tagged with 'wool' before proceeding. ```Skript on click on wool: if event-block is tagged with minecraft tag "wool": message "This wool block is <%color of block%>%color of block%!" set the color of the block to black ``` -------------------------------- ### start() - ErrorDescLogHandler Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts the ErrorDescLogHandler. This method is part of the logging utility in Skript. ```APIDOC ## start() ### Description Starts the ErrorDescLogHandler. ### Method Method ### Endpoint N/A (Java Method) ### Parameters None ### Request Example N/A ### Response N/A ``` -------------------------------- ### Skript Example: Getting Timespan Value Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/common/properties/elements/expressions/PropExprValueOf.html Illustrates retrieving the value of a configuration node and interpreting it as a timespan (duration). This highlights the automatic type conversion capabilities of the 'ValueOf' expression. ```skript wait for {_node}'s timespan value # timespan value of {_node} = 12 hours (duration) ``` -------------------------------- ### Get Causing Entity of Damage Source in Skript Source: https://github.com/skriptlang/skript-docs/blob/main/docs/docs.html This example shows how to retrieve the entity that ultimately caused the damage from a damage source. Requires Skript version 2.12 or later. ```skript set {\_source} to a custom damage source: set the damage type to magic set the causing entity to {\_player} set the direct entity to {\_arrow} set the damage location to location(0, 0, 10) on damage: set {\_causing} to the causing entity of event-damage source ``` -------------------------------- ### initSelf Method Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/potion/PotionModule.html Initializes the module's internal components with the provided SkriptAddon. ```APIDOC ## initSelf(SkriptAddon) ### Description This method is called during the initialization phase to set up the module's internal state. ### Method Signature `protected void initSelf(SkriptAddon addon)` ### Parameters * **addon** (SkriptAddon) - The Skript addon instance. ``` -------------------------------- ### Get Raw String Without Formatting Source: https://github.com/skriptlang/skript-docs/blob/main/docs/expressions.html Returns a string without any formatting (colors, decorations, etc.) applied. For example, `raw "&aHello There!"` will output `&aHello There!`. ```skript send raw "&aThis text is unformatted!" to all players ``` -------------------------------- ### Create and Manipulate Queues Source: https://github.com/skriptlang/skript-docs/blob/main/docs/expressions.html Demonstrates creating a new queue, adding elements to it, and removing elements from either the start or end. Requires the 'using queues' experimental feature flag. ```skript set {queue} to a new queue add "hello" and "there" to {queue} broadcast the first element of {queue} # hello broadcast the first element of {queue} # there # queue is now empty ``` ```skript set {queue} to a new queue of "hello" and "there" broadcast the last element of {queue} # removes 'there' add "world" to {queue} broadcast the first 2 elements of {queue} # removes 'hello', 'world' ``` -------------------------------- ### getExamples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/lang/SkriptEventInfo.html Retrieves the examples for the event. This method is deprecated and intended for removal. ```APIDOC ## getExamples ### Description Retrieves the examples for the event. This method is deprecated and intended for removal. ### Returns String[] - The examples for the event ``` -------------------------------- ### Get Heal Reason in Skript Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprHealReason.html This example shows how to check the reason for a heal event in Skript. It uses the 'heal reason' expression to compare against predefined reasons like 'satiated'. ```skript on heal: if heal reason = satiated: send "You ate enough food and gained health back!" to player ``` -------------------------------- ### Example Usage with Dropped Items Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprPickupDelay.html This example demonstrates how to drop an item at a specific location and then set its pickup delay. This is useful for creating custom drop mechanics. ```skript drop diamond sword at {_location} without velocity ``` -------------------------------- ### Entity Targeting Examples Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprTarget.html Demonstrates how to use the 'target' expression to get, reset, or delete an entity's target. This is useful for creating custom AI behaviors or tracking player interactions. ```skript on entity target: if entity's target is a player: send "You're being followed by an %entity%!" to target of entity ``` ```skript reset target of entity # Makes the entity target-less ``` ```skript delete targeted entity of player # for players it will delete the target ``` ```skript delete target of last spawned zombie # for entities it will make them target-less ``` -------------------------------- ### Get Light Level at Player Location Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/expressions/ExprLightLevel.html This example demonstrates how to check the sunlight level at a player's location. It's used here to ignite players who are vampires and standing in bright sunlight. ```skript every 5 seconds: loop all players: {vampire::%uuid of loop-player%} is true sunlight level at the loop-player is greater than 10 ignite the loop-player for 5 seconds ``` -------------------------------- ### clearExamples() Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Removes all examples from the event's documentation. ```APIDOC ## clearExamples() ### Description Removes all examples from the event's documentation. ### Method `clearExamples()` ### Interface `org.skriptlang.skript.bukkit.registration.BukkitSyntaxInfos.Event.Builder` ``` -------------------------------- ### Loading Server Icons and Storing Them Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/effects/EffLoadServerIcon.html This example demonstrates how to load multiple server icons and store them in a Skript variable for later use. It iterates a set number of times, loading an icon from a file path and adding it to a list. ```skript on load: clear {server-icons:: *} loop 5 times: load server icon from file "icons/%loop-number%.png" add the last loaded server icon to {server-icons::*} ``` -------------------------------- ### CondStartsEndsWith Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/conditions/CondStartsEndsWith.html The CondStartsEndsWith class is a Skript condition that checks if a text starts or ends with a specified string or multiple strings. It is annotated with @Name("Starts/Ends With"), @Description("Checks if a text starts or ends with another."), and @Examples({"if the argument starts with \"test\" or \"debug\":", "\tsend \"Stop!\""}). It supports multiple strings since version 2.5.1. ```APIDOC ## CondStartsEndsWith ### Description Checks if a text starts or ends with another string or a list of strings. ### Annotations - @Name("Starts/Ends With") - @Description("Checks if a text starts or ends with another.") - @Examples({"if the argument starts with \"test\" or \"debug\":", "\tsend \"Stop!\""}) - @Since("2.2-dev36, 2.5.1 (multiple strings support)") ### Class Hierarchy - java.lang.Object - ch.njol.skript.lang.TriggerItem - ch.njol.skript.lang.Statement - ch.njol.skript.lang.Condition - ch.njol.skript.conditions.CondStartsEndsWith ### Implemented Interfaces - ch.njol.skript.lang.Debuggable - ch.njol.skript.lang.SyntaxElement ### Methods - `boolean check(org.bukkit.event.Event e)`: Checks whether this condition is satisfied with the given event. - `boolean init(Expression[] exprs, int matchedPattern, Kleenean isDelayed, SkriptParser.ParseResult parseResult)`: Called just after the constructor. - `String toString(org.bukkit.event.Event e, boolean debug)`: Returns a string representation of the condition. ``` -------------------------------- ### init Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/addon/AddonModule.html Initializes the addon module with the provided SkriptAddon. ```APIDOC ## init ### Description Initializes the addon module with the provided SkriptAddon. ### Method Signature - `init(SkriptAddon addon)` ``` -------------------------------- ### Get and Set Custom Model Data Source: https://github.com/skriptlang/skript-docs/blob/main/docs/docs.html Examples for retrieving or modifying the custom model data of an item, including basic integer values and more complex data types introduced in later versions. ```skript set custom model data of player's tool to 3 ``` ```skript set {_model} to custom model data of player's tool ``` ```skript set custom model data colours of {_flag} to red, white, and blue ``` ```skript add 10.5 to the model data floats of {_flag} ``` ```skript set the full custom model data of {_item} to 10, "sword", and rgb(100, 200, 30) ``` -------------------------------- ### startLogHandler(T) Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/index-all.html Starts a log handler. ```APIDOC ## startLogHandler(T handler) ### Description Starts a log handler. ### Method Static method ### Endpoint N/A (Java Method) ### Parameters * **handler** (T) - The log handler to start. ### Request Example N/A ### Response N/A ``` -------------------------------- ### initSelf Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/bukkit/damagesource/DamageSourceModule.html Initializes the module for the given Skript addon. ```APIDOC ## initSelf(SkriptAddon) ### Description Initializes the module for the given Skript addon. ### Method `initSelf` ### Parameters * **addon** (SkriptAddon) - The Skript addon for which to initialize the module. ``` -------------------------------- ### Skript Example: Getting and Broadcasting Text Value Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/org/skriptlang/skript/common/properties/elements/expressions/PropExprValueOf.html Demonstrates how to set a variable to a configuration node's value and then broadcast that value as text. This snippet shows the basic usage of 'ValueOf' for text retrieval. ```skript set {_node} to node "update check interval" in the skript config broadcast text value of {_node} # text value of {_node} = "12 hours" (text) ``` -------------------------------- ### initialize Source: https://github.com/skriptlang/skript-docs/blob/main/docs/javadocs/ch/njol/skript/test/platform/Environment.html Initializes the Skript environment with specified data and runner roots, and a flag to remake the environment. ```APIDOC ## initialize ### Description Initializes the Skript environment with specified data and runner roots, and a flag to remake the environment. ### Signature `public void initialize(Path dataRoot, Path runnerRoot, boolean remake) throws IOException` ### Parameters * **dataRoot** (Path) - The root path for data files. * **runnerRoot** (Path) - The root path for runner files. * **remake** (boolean) - A flag indicating whether to remake the environment. ### Throws * **IOException** - If an I/O error occurs during initialization. ```