### Skript @Example Annotation Usage Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/doc/Example Demonstrates how to use the @Example annotation in Java to provide code examples for Skript syntax. It shows single-line and multi-line examples, including comments. ```java @Target(TYPE) @Retention(RUNTIME) @Repeatable(Example.Examples.class) @Documented public @interface Example { String value(); boolean inTrigger() default true; } // Usage in a class: @Example("set player's health to 1") @Example(""" if player's health is greater than 10: send "Wow you're really healthy!" """) @Example(""" # sets the player's health to 1 set player's health to 1""") public class MyExpression extends ... { } ``` -------------------------------- ### Skript Loop Syntax Examples Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/LoopSection Illustrates common loop structures in Skript, such as 'while' loops and general 'loop' constructs. These examples demonstrate how to define and use loops for repetitive tasks within Skript scripts. ```skript while condition: # code to execute while condition is true loop { # code to execute repeatedly } ``` -------------------------------- ### Date Usage Example Source: https://docs.skriptlang.org/classes Demonstrates how to get the current date and subtract a day from it in Skript. ```skript set {_yesterday} to now subtract a day from {_yesterday} # now {_yesterday} represents the date 24 hours before now ``` -------------------------------- ### Skript Command Help Overview Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/command/CommandHelp Provides an overview of the Skript command help system, including navigation links to different sections like package summary, class details, constructors, and methods. It also includes links to deprecated classes, index, and help sections. ```APIDOC ch.njol.skript.command.CommandHelp: Overview: Provides an overview of the Skript command help system. Navigation: - Package Summary: https://docs.skriptlang.org/javadocs/ch/njol/skript/command/package-summary.html - Class Tree: https://docs.skriptlang.org/javadocs/ch/njol/skript/command/package-tree.html - Deprecated List: https://docs.skriptlang.org/javadocs/deprecated-list.html - Index: https://docs.skriptlang.org/javadocs/index-all.html - Help Section: https://docs.skriptlang.org/javadocs/help-doc.html#class Sections: - Summary: - Nested Classes/Interfaces - Fields - Constructors: https://docs.skriptlang.org/javadocs/ch/njol/skript/command/CommandHelp.html#constructor-summary - Methods: https://docs.skriptlang.org/javadocs/ch/njol/skript/command/CommandHelp.html#method-summary - Detail: - Fields - Constructors: https://docs.skriptlang.org/javadocs/ch/njol/skript/command/CommandHelp.html#constructor-detail - Methods: https://docs.skriptlang.org/javadocs/ch/njol/skript/command/CommandHelp.html#method-detail Search: https://docs.skriptlang.org/javadocs/search.html ``` -------------------------------- ### Server Start/Stop Events Source: https://docs.skriptlang.org/events These events are triggered when the Skript environment or the server itself starts or stops. A server reload will also trigger these events. They are useful for global setup and cleanup tasks. ```skript on skript start: on server stop: ``` -------------------------------- ### Skript Structure Initialization and Loading Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/lang/structure/Structure Details the initialization and loading phases of a Skript Structure. Includes methods like init(), preInit(), postInit(), load(), preLoad(), postLoad(), and unload(). These methods are essential for setting up and managing custom syntax elements within Skript. ```APIDOC Structure: init(expressions: Expression[], matchedPattern: int, isDelayed: Kleenean, parseResult: SkriptParser.ParseResult): boolean Called just after the constructor and SyntaxElement.preInit(). Parameters: expressions: An array of Expression objects. matchedPattern: The matched pattern integer. isDelayed: A Kleenean enum indicating if the structure is delayed. parseResult: The SkriptParser.ParseResult object. Returns: A boolean indicating success. init(args: Literal[], matchedPattern: int, parseResult: SkriptParser.ParseResult, entryContainer: EntryContainer): boolean The initialization phase of a Structure. Parameters: args: An array of Literal objects. matchedPattern: The matched pattern integer. parseResult: The SkriptParser.ParseResult object. entryContainer: The EntryContainer object. Returns: A boolean indicating success. load(): Structure The second phase of Structure loading. Returns: The Structure object. postLoad(): boolean The third and final phase of Structure loading. Returns: A boolean indicating success. preLoad(): boolean The first phase of Structure loading. Returns: A boolean indicating success. unload(): void Called when this structure is unloaded. ``` -------------------------------- ### Java Example: Creating a ContextlessEvent Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/util/ContextlessEvent This Java code snippet demonstrates how to obtain an instance of ContextlessEvent using its static `get()` method. This is useful in Skript development when a placeholder event is needed. ```java import ch.njol.skript.lang.util.ContextlessEvent; import org.bukkit.event.Event; // ... inside some method or class Event event = ContextlessEvent.get(); // Now 'event' can be used where an Event object is required but no specific context is available. ``` -------------------------------- ### SyntaxElement init Method Documentation Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/fishing/elements/ExprFishingBiteTime Provides detailed documentation for the init method of the SyntaxElement interface, explaining its parameters and return value. This method is called after the constructor and preInit to initialize the syntax element. ```APIDOC init(expressions: Expression[], matchedPattern: int, isDelayed: Kleenean, parseResult: SkriptParser.ParseResult): boolean - Called just after the constructor and preInit(). - Parameters: - expressions: Array of %expr%s included in the matching pattern. - matchedPattern: The index of the pattern which matched. - isDelayed: Whether this expression is used after a delay. - parseResult: Additional information about the match. - Returns: Whether this expression was initialised successfully. ``` -------------------------------- ### Get Experience for Level Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/bukkitutil/PlayerUtils Calculates the experience points required to advance from a given level to the next. For example, getLevelXP(30) returns the XP needed to go from level 30 to 31. ```java public static int getLevelXP(int level) Gets the experience points needed to reach the next level, starting at the given level. E.g. getLevelXP(30) returns the experience points needed to reach level 31 from level 30. Parameters: `level` - The starting level Returns: The experience points needed to reach the next level ``` -------------------------------- ### EvtFurnace Constructor and Initialization Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/furnace/elements/EvtFurnace Details the constructor for EvtFurnace and its initialization process, including inherited methods from SyntaxElement. ```APIDOC EvtFurnace() - Constructor for the EvtFurnace class. init(Literal[] exprs, int matchedPattern, SkriptParser.ParseResult parseResult) - Called just after the constructor. - Inherited from SkriptEvent. - Parameters: - exprs: An array of Literal objects representing expressions. - matchedPattern: The index of the matched pattern. - parseResult: The result of the Skript parsing. - Returns: true if initialization is successful, false otherwise. ``` -------------------------------- ### FoxData Initialization Methods Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/entity/FoxData Explains the methods used to initialize FoxData, either from parsed syntax elements or from an entity class/instance. ```APIDOC protected boolean init([Literal]<>[] exprs, int matchedPattern, SkriptParser.ParseResult parseResult): Initializes FoxData from parsed Skript syntax elements. Parameters: exprs: Array of Literal expressions from the matched pattern. matchedPattern: The index of the pattern that matched. parseResult: Additional information from the parser. Returns: true if initialization is successful, false otherwise. Description copied from class: EntityData. Initializes this EntityData from the matched pattern and its associated literals. This is used when parsing entity data from user-written patterns such as "a saddled pig". protected boolean init(@Nullable Class c, @Nullable org.bukkit.entity.Fox fox): Initializes FoxData from an entity class or a specific Entity instance. Parameters: c: The entity's class (e.g., Player). fox: An actual entity, or null to get entity data for an entity class. Returns: true if initialization is successful, false otherwise. Description copied from class: EntityData. Applies this EntityData to a newly spawned Entity. This is used during entity spawning to set additional data, such as a saddled pig. ``` -------------------------------- ### Java Relation Enum Methods Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/lang/comparator/Relation Example Java code demonstrating the usage of the Skript Relation enum's static 'get' methods for converting primitive types to Relation enums. ```Java import org.skriptlang.skript.lang.comparator.Relation; public class RelationExample { public static void main(String[] args) { Relation relFromBoolean = Relation.get(true); System.out.println("Relation from true: " + relFromBoolean); // Output: EQUAL Relation relFromInt = Relation.get(5); System.out.println("Relation from 5: " + relFromInt); // Output: GREATER Relation relFromDouble = Relation.get(-2.5); System.out.println("Relation from -2.5: " + relFromDouble); // Output: SMALLER Relation greaterOrEqual = Relation.GREATER_OR_EQUAL; Relation equal = Relation.EQUAL; System.out.println("Is GREATER_OR_EQUAL implied by EQUAL? " + greaterOrEqual.isImpliedBy(equal)); // Output: true System.out.println("String representation of SMALLER: " + Relation.SMALLER.toString()); // Output: SMALLER System.out.println("Inverse of GREATER: " + Relation.GREATER.getInverse()); // Output: SMALLER } } ``` -------------------------------- ### ExprTagKey - Get Tag Namespaced Key Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/tags/elements/ExprTagKey Retrieves the namespaced key of a Minecraft tag. This key is formatted as 'namespace:key', for example, 'minecraft:dirt'. This expression is useful for comparing or displaying tag identifiers. ```skript broadcast namespaced keys of the tags of player's tool if the key of {_my-tag} is "minecraft:stone": return true ``` ```java ch.njol.skript.doc.Name("Tag Namespaced Key") ch.njol.skript.doc.Description("The namespaced key of a minecraft tag. This takes the form of \"namespace:key\", e.g. \"minecraft:dirt\".") ch.njol.skript.doc.Examples({"broadcast namespaced keys of the tags of player's tool","if the key of {_my-tag} is \"minecraft:stone\":","\treturn true"}) ch.njol.skript.doc.Since("2.10") ch.njol.skript.doc.Keywords({"minecraft tag","type","key","namespace"}) public class ExprTagKey extends ch.njol.skript.expressions.base.SimplePropertyExpression,String> ``` -------------------------------- ### InputModule Constructor and Load Method Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/input/InputModule Provides documentation for the InputModule class, including its default constructor and the static 'load' method used for initializing input modules. ```APIDOC Class InputModule java.lang.Object org.skriptlang.skript.bukkit.input.InputModule Constructor Summary: Constructors Constructor Description InputModule() Initializes a new instance of the InputModule class. Method Summary: All Methods Static Methods Concrete Methods Modifier and Type Method Description static void load() Loads the input module. This method is static and does not take any parameters. ``` -------------------------------- ### Skript Interface API Documentation Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/Skript This section details the methods available in the Skript interface, which serves as the main entry point for Skript functionalities. It covers addon management and view creation. ```APIDOC Interface Skript All Superinterfaces: SkriptAddon, ViewProvider @Experimental public interface Skript extends SkriptAddon The main class for everything related to Skript. Method Summary: All MethodsStatic MethodsInstance MethodsAbstract MethodsDefault Methods Modifier and Type Method Description @Unmodifiable Collection addons() Returns an unmodifiable collection of registered Skript addons. static Skript of(Class source, String name) Constructs a default implementation of a Skript. Parameters: source: The class that is requesting the Skript instance. name: The name of the Skript instance. SkriptAddon registerAddon(Class source, String name) Registers the provided addon with this Skript and loads the provided modules. Parameters: source: The class of the addon to register. name: The name of the addon. default Skript unmodifiableView() Constructs an unmodifiable view of this Skript. ``` -------------------------------- ### Get Cumulative Experience for Level Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/bukkitutil/PlayerUtils Calculates the total experience points needed to reach a specific level from level 0. For example, getCumulativeXP(30) returns the total XP needed to reach level 30. ```java public static int getCumulativeXP(int level) Gets the cumulative experience needed to reach the given level, but no further. E.g. getCumulativeXP(30) returns the experience points needed to reach level 30 from level 0. Parameters: `level` - The level to get the cumulative XP for Returns: The experience points needed to reach the given level ``` -------------------------------- ### Get and Set Fishing Bite Time Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/fishing/elements/ExprFishingBiteTime This expression allows you to retrieve the current fishing bite time and set a new value. The bite time determines how long a fish waits before biting the hook after it starts approaching. When setting the time, it should be at least 1 tick. ```skript on fish approach: set fishing bite time to 5 seconds # To get the value: set {_biteTime} to fishing bite time ``` -------------------------------- ### Skript Experience Class API Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/util/Experience This section details the constructors and methods available for the Skript Experience class. It covers initialization, retrieval of experience points, and comparison methods. ```APIDOC Experience: Inherits from: YggdrasilSerializable Constructors: Experience() Description: Initializes a new Experience object with default values. Experience(int xp) Parameters: xp (int): The initial experience points. Description: Initializes a new Experience object with the specified experience points. Methods: equals(@Nullable Object obj) Parameters: obj (@Nullable Object): The object to compare with. Returns: boolean Description: Compares this Experience object with another object for equality. getInternalXP(): int Returns: int Description: Retrieves the internal experience points value. getXP(): int Returns: int Description: Retrieves the experience points value. hashCode(): int Returns: int Description: Returns a hash code value for the Experience object. toString(): String Returns: String Description: Returns a string representation of the Experience object. ``` -------------------------------- ### Skriptlang Examples Annotation Interface Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/doc/Examples The 'Examples' annotation interface in Skriptlang is used to associate code examples with specific elements in the documentation. It requires a 'value' element, which is an array of strings, where each string represents a code example. ```APIDOC @Target(TYPE) @Retention(RUNTIME) @Documented public @interface Examples { String[] value(); } ``` -------------------------------- ### ParserInstance Class Detail Links Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/parser/ParserInstance Provides detail links for the ParserInstance class, focusing on constructors and methods. ```javadoc * Detail: * Field | * [Constr](https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/parser/ParserInstance.html#constructor-detail) | * [Method](https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/parser/ParserInstance.html#method-detail) ``` -------------------------------- ### EquipmentSlot Methods Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/util/slot/EquipmentSlot Provides documentation for various methods within the Skript EquipmentSlot class, including getting item amounts, the Bukkit EquipmentSlot, and the slot's index. Also includes methods for setting item amounts and items. ```APIDOC EquipmentSlot: getAmount() -> int Returns the amount of items in the slot. getEquipmentSlot() -> org.bukkit.inventory.EquipmentSlot Gets the corresponding Bukkit EquipmentSlot. getEquipSlot() -> EquipmentSlot.EquipSlot Deprecated, for removal: Use EquipmentSlot(EntityEquipment, org.bukkit.inventory.EquipmentSlot) and getEquipmentSlot() instead. getIndex() -> int Gets an index of this slot. getItem() -> @Nullable org.bukkit.inventory.ItemStack Returns the ItemStack in the slot. setAmount(amount: int) -> void Sets the amount of items in the slot. setItem(item: @Nullable org.bukkit.inventory.ItemStack) -> void Sets the ItemStack in the slot. toString(event: @Nullable org.bukkit.event.Event, debug: boolean) -> String Converts the slot information to a string representation, with optional debug information. ``` -------------------------------- ### BukkitSyntaxInfos.Event Builder Methods Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/registration/BukkitSyntaxInfos.Event Provides methods for creating and configuring Skript event syntax information. Includes a static builder method and a method to obtain a builder from an existing SyntaxInfo. ```APIDOC builder(Class eventClass, String name) Parameters: eventClass: The Structure class the info will represent. name: The name of the SkriptEvent. Returns: A Structure-specific builder for creating a syntax info representing type. toBuilder() Returns: A builder representing this SyntaxInfo. ``` -------------------------------- ### On Start Smelt Event Source: https://docs.skriptlang.org/events Triggered when an item starts smelting in a furnace. ```skript on start smelt: # Code to execute when an item starts smelting ``` -------------------------------- ### Skriptlang Annotations for Documentation Source: https://docs.skriptlang.org/javadocs/allclasses-index This section details annotations used within Skriptlang for generating documentation. It includes annotations for marking examples, grouping examples, and providing lists of examples for annotated elements. ```APIDOC Example: annotation interface in ch.njol.skript.doc An example to be used in documentation for the annotated element. Example.Examples: annotation interface in ch.njol.skript.doc The internal container annotation for multiple examples. Examples: annotation interface in ch.njol.skript.doc Provides a list of examples to be used in documentation for annotated element. ``` -------------------------------- ### setupMetrics Method Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/SkriptMetrics Helper method to set up bstats charts on the supplied Metrics object. This method takes a Metrics object as input and configures it with charts for bstats. ```APIDOC setupMetrics(org.bstats.bukkit.Metrics metrics) Helper method to set up bstats charts on the supplied Metrics object Parameters: metrics: The Metrics object to which charts will be added. ``` -------------------------------- ### EntityData Supertype Example Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/entity/EndermanData Illustrates the usage of the isSupertypeOf method with a practical example in Skript. ```APIDOC if a zombie is a monster: # passes: "monster" is a supertype of "zombie" if a monster is a zombie: # fails: "zombie" is not a supertype of "monster" ``` -------------------------------- ### ExprCurrentInputKeys Constructor and Methods Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/input/elements/expressions/ExprCurrentInputKeys Details the constructor, initialization, and core methods of the ExprCurrentInputKeys class, including how it inherits from SyntaxRuntimeErrorProducer and PropertyExpression. ```APIDOC ExprCurrentInputKeys: __init__() Constructor for ExprCurrentInputKeys. init(expressions: Expression[], matchedPattern: int, isDelayed: Kleenean, parseResult: SkriptParser.ParseResult): boolean Description copied from interface: SyntaxElement.init(expressions, matchedPattern, isDelayed, parseResult) Called just after the constructor and SyntaxElement.preInit(). Parameters: expressions - all %expr%s included in the matching pattern in the order they appear in the pattern. If an optional value was left out, it will still be included in this list holding the default value of the desired type, which usually depends on the event. matchedPattern - The index of the pattern which matched isDelayed - Whether this expression is used after a delay or not (i.e. if the event has already passed when this expression will be called) parseResult - Additional information about the match. Returns: Whether this expression was initialised successfully. An error should be printed prior to returning false to specify the cause. See Also: * ParserInstance.isCurrentEvent(Class...) get(event: Event, source: Player[]): InputKey[] Specified by: get in class ch.njol.skript.expressions.base.PropertyExpression isSingle(): boolean Specified by: isSingle in interface Expression Overrides: isSingle in class ch.njol.skript.expressions.base.PropertyExpression Returns: true if this expression will ever only return one value at most, false if it can return multiple values. getReturnType(): Class (Method signature incomplete in provided text, likely returns the return type of the expression) ``` -------------------------------- ### Disable Variable Starting With Expression Warnings Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/SkriptConfig Toggles warnings for variables that start with an expression. This is a boolean option. ```java public static final Option disableVariableStartingWithExpressionWarnings ``` -------------------------------- ### SkriptLang Parser Package Navigation Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/parser/ParserInstance Navigation links for the SkriptLang parser package, including search and package summary. ```javadoc [SEARCH](https://docs.skriptlang.org/javadocs/search.html) Package [ch.njol.skript.lang.parser](https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/parser/package-summary.html) ``` -------------------------------- ### Direction Usage Example Source: https://docs.skriptlang.org/classes Provides examples of how to manipulate blocks based on direction in Skript. This includes setting blocks below, in front of, or behind entities. ```skript set the block below the victim to a chest loop blocks from the block infront of the player to the block 10 below the player: set the block behind the loop-block to water ``` -------------------------------- ### EvtFish Constructor and Methods Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/fishing/elements/EvtFish Details the constructor and key methods for the EvtFish class, including initialization, event checking, and string representation. Inherits methods from SyntaxElement. ```APIDOC EvtFish: __init__() Constructs an EvtFish object. init(args: Literal[], matchedPattern: int, parseResult: SkriptParser.ParseResult): boolean Called just after the constructor. Inherited from SkriptEvent. Parameters: args: An array of Literals representing the arguments. matchedPattern: The index of the matched pattern. parseResult: The result of the Skript parsing. Returns: True if initialization is successful, false otherwise. check(event: org.bukkit.event.Event): boolean Checks if the given Bukkit Event applies to this SkriptEvent. Inherited from SkriptEvent. Parameters: event: The Bukkit event to check. Returns: True if the event applies, false otherwise. toString(event: org.bukkit.event.Event, debug: boolean): String Returns a string representation of the object. Inherited from SkriptEvent. Parameters: event: The event to get information from (null if debug is false). debug: If true, prints more information; otherwise, prints user-facing information. Returns: The string representation. ``` -------------------------------- ### Skriptlang Section Constructor and Methods Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/Section Details the constructor and key methods of the Skriptlang Section class, including preInit and init, which are crucial for Skript syntax element initialization. ```APIDOC Section: __init__() Constructs a new Section. preInit() Called immediately after the constructor. Used for pre-initialization tasks before downstream initialization. Returns: boolean - Whether pre-initialization was successful. init(expressions, matchedPattern, isDelayed, parseResult) Initializes the Section with parsed expressions and pattern information. This method should generally not be overridden. Parameters: expressions: Array of Expression - Parsed expressions from the pattern. matchedPattern: int - The index of the matched pattern. isDelayed: Kleenean - Indicates if the expression is called after a delay. parseResult: SkriptParser.ParseResult - Additional match information. Returns: boolean - Whether initialization was successful. init(expressions, matchedPattern, isDelayed, parseResult, sectionNode, triggerItems) Abstract method for initializing the Section with more detailed context, including section node and trigger items. Intended for overriding by subclasses. Parameters: expressions: Array of Expression - Parsed expressions from the pattern. matchedPattern: int - The index of the matched pattern. isDelayed: Kleenean - Indicates if the expression is called after a delay. parseResult: SkriptParser.ParseResult - Additional match information. sectionNode: SectionNode - The node representing the section in the configuration. triggerItems: List - A list of trigger items associated with the section. Returns: boolean - Whether initialization was successful. ``` -------------------------------- ### Skript Entity Matching Example Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/entity/BoatData An example demonstrating how to check if an entity is a specific type, like a 'saddled pig', within a Skript context. ```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 ``` -------------------------------- ### Skriptlang Configuration Class Documentation Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/config/Node Provides access to the Skriptlang configuration class documentation. This includes links to the summary and detail views for fields, constructors, and methods within the ch.njol.skript.config package. ```javadoc Project: /context7/skriptlang Package [ch.njol.skript.config](https://docs.skriptlang.org/javadocs/ch/njol/skript/config/package-summary.html) * [Overview](https://docs.skriptlang.org/javadocs/index.html) * [Package](https://docs.skriptlang.org/javadocs/ch/njol/skript/config/package-summary.html) * Class * [Tree](https://docs.skriptlang.org/javadocs/ch/njol/skript/config/package-tree.html) * [Deprecated](https://docs.skriptlang.org/javadocs/deprecated-list.html) * [Index](https://docs.skriptlang.org/javadocs/index-all.html) * [Help](https://docs.skriptlang.org/javadocs/help-doc.html#class) * Summary: * Nested * [Field](https://docs.skriptlang.org/javadocs/ch/njol/skript/config/Node.html#field-summary) * [Constr](https://docs.skriptlang.org/javadocs/ch/njol/skript/config/Node.html#constructor-summary) * [Method](https://docs.skriptlang.org/javadocs/ch/njol/skript/config/Node.html#method-summary) * Detail: * [Field](https://docs.skriptlang.org/javadocs/ch/njol/skript/config/Node.html#field-detail) * [Constr](https://docs.skriptlang.org/javadocs/ch/njol/skript/config/Node.html#constructor-detail) * [Method](https://docs.skriptlang.org/javadocs/ch/njol/skript/config/Node.html#method-detail) [SEARCH](https://docs.skriptlang.org/javadocs/search.html) ``` -------------------------------- ### Starts With / Ends With Condition Source: https://docs.skriptlang.org/conditions Determines if a given text string starts or ends with another specified text string. Supports checking against multiple strings. ```skript if the argument starts with "test" or "debug": send "Stop!" ``` -------------------------------- ### Skriptlang Class Navigation - Simplified Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/classes/ClassInfo A more concise set of links for Skriptlang class navigation, focusing on summary and detail sections for fields, constructors, and methods. ```javadoc * Summary: * Nested | * [Field](https://docs.skriptlang.org/javadocs/ch/njol/skript/classes/ClassInfo.html#field-summary) | * [Constr](https://docs.skriptlang.org/javadocs/ch/njol/skript/classes/ClassInfo.html#constructor-summary) | * [Method](https://docs.skriptlang.org/javadocs/ch/njol/skript/classes/ClassInfo.html#method-summary) * Detail: * [Field](https://docs.skriptlang.org/javadocs/ch/njol/skript/classes/ClassInfo.html#field-detail) | * [Constr](https://docs.skriptlang.org/javadocs/ch/njol/skript/classes/ClassInfo.html#constructor-detail) | * [Method](https://docs.skriptlang.org/javadocs/ch/njol/skript/classes/ClassInfo.html#method-detail) ``` -------------------------------- ### ExprFurnaceTime Get and AcceptChange Methods Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/furnace/elements/ExprFurnaceTime Documentation for the get and acceptChange methods of the ExprFurnaceTime class, related to retrieving and modifying Timespan values. ```APIDOC ExprFurnaceTime: get(event: Event, source: Block[]): Timespan[] | null - Retrieves Timespan values associated with a Block event. - Specified by: get in PropertyExpression. acceptChange(mode: Changer.ChangeMode): Class[] | null - Tests whether this expression supports the given mode and the type of the delta. - Note: Use Changer.ChangerUtils.acceptsChange() instead of calling this directly. ``` -------------------------------- ### SQLStorage Constructor and Methods Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/variables/SQLStorage Details the constructor and key methods of the SQLStorage class. The constructor initializes the storage with a database type and a table creation query. Methods include getting and setting the table name, and initializing the database with a configuration. ```APIDOC SQLStorage(String type, String createTableQuery) Description: Creates a SQLStorage with a create table query. Parameters: type: The database type (e.g., CSV). createTableQuery: The query to create the table. getTableName(): String Description: Retrieves the name of the SQL table. setTableName(String tableName): void Description: Sets the name of the SQL table. initialize(SectionNode config): Database Description: Initializes an SQL database using a provided configuration section. Parameters: config: The SectionNode containing the database configuration. Returns: The initialized Database object. ``` -------------------------------- ### Skript Fishing Expressions Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/fishing/elements/package-summary Expressions that retrieve data related to fishing. ExprFishingApproachAngle gets the angle of the fishing bobber's approach, ExprFishingBiteTime retrieves the time until the next bite, ExprFishingHook gets the fishing hook, ExprFishingHookEntity retrieves the entity attached to the hook, and ExprFishingWaitTime gets the time until the next fish bites. ```skript ExprFishingApproachAngle: Gets the angle of the fishing bobber's approach. ExprFishingBiteTime: Retrieves the time until the next fish bites. ExprFishingHook: Gets the fishing hook. ExprFishingHookEntity: Retrieves the entity attached to the fishing hook. ExprFishingWaitTime: Gets the time until the next fish bites. ``` -------------------------------- ### LogHandler Start Method Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/log/RedirectingLogHandler The `start()` method in the `LogHandler` class is used to initiate the logging process. It is part of the core logging functionality within Skriptlang. ```APIDOC LogHandler: start() Overrides the start method in the LogHandler class. ``` -------------------------------- ### Skript Event Documentation Builder Methods Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/registration/BukkitSyntaxInfos.Event.Builder This section details the methods available in the BukkitSyntaxInfos.Event.Builder class for constructing event documentation. It covers adding related events, providing single or multiple examples, defining keywords, and specifying required plugins. ```APIDOC BukkitSyntaxInfos.Event.Builder: addEvents(events: Collection>) Adds events to the event's documentation. Parameters: events: A collection of event classes to associate with this documentation. addExample(example: String) Adds a single example to the event's documentation. Parameters: example: The example string to add. addExamples(examples: String...) Adds multiple examples to the event's documentation. Parameters: examples: A varargs array of example strings to add. addExamples(examples: Collection) Adds multiple examples to the event's documentation from a collection. Parameters: examples: A collection of example strings to add. addKeyword(keyword: String) Adds a keyword to the event's documentation. Parameters: keyword: The keyword string to add. addKeywords(keywords: String...) Adds multiple keywords to the event's documentation. Parameters: keywords: A varargs array of keyword strings to add. addKeywords(keywords: Collection) Adds multiple keywords to the event's documentation from a collection. Parameters: keywords: A collection of keyword strings to add. addRequiredPlugin(plugin: String) Adds a required plugin to the event's documentation. Parameters: plugin: The name of the required plugin. ``` -------------------------------- ### Skript Configuration and Updates Source: https://docs.skriptlang.org/javadocs/overview-tree Documentation for classes related to Skript's configuration loading and update management, including ConfigReader, ReleaseChannel, and ReleaseManifest. ```APIDOC ch.njol.skript.config.ConfigReader - Extends java.io.BufferedReader. - Handles reading configuration files. ch.njol.skript.update.ReleaseChannel - Represents a release channel for Skript updates. ch.njol.skript.update.ReleaseManifest - Contains information about a Skript release. ``` -------------------------------- ### Skript Entity Spawning Example Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/entity/SalmonData An example of spawning a Salmon entity in Skript and setting its data. This demonstrates how to use the SalmonData class in a Skript context. ```skript spawn a pig at location(0, 0, 0): set {_entity} to event-entity spawn {_entity} at location(0, 0, 0) ``` -------------------------------- ### Skriptlang Utility Navigation Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/util/common/AnyProvider Provides navigation links for Skriptlang Javadocs, including links to overview, package details, class hierarchy, deprecated items, index, and help. ```javadoc [Skip navigation links](https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/util/common/AnyProvider.html#skip-navbar-top "Skip navigation links") * [Overview](https://docs.skriptlang.org/javadocs/index.html) * [Package](https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/util/common/package-summary.html) * Class * [Tree](https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/util/common/package-tree.html) * [Deprecated](https://docs.skriptlang.org/javadocs/deprecated-list.html) * [Index](https://docs.skriptlang.org/javadocs/index-all.html) * [Help](https://docs.skriptlang.org/javadocs/help-doc.html#class) * Summary: * Nested * Field * Constr * Method * Detail: * Field * Constr * Method * Summary: * Nested | * Field | * Constr | * Method * Detail: * Field | * Constr | * Method [SEARCH](https://docs.skriptlang.org/javadocs/search.html) Package [ch.njol.skript.lang.util.common](https://docs.skriptlang.org/javadocs/ch/njol/skript/lang/util/common/package-summary.html) ``` -------------------------------- ### Game Starting Counter Source: https://docs.skriptlang.org/effects This script implements a countdown timer starting from 11. It broadcasts the remaining time only when the counter is 1, 2, 3, 5, or 10 seconds. ```skript # Game starting counter set {_counter} to 11 while {_counter} > 0: remove 1 from {_counter} wait a second if {_counter} != 1, 2, 3, 5 or 10: continue # only print when counter is 1, 2, 3, 5 or 10 broadcast "Game starting in %{_counter}% second(s)" ``` -------------------------------- ### Get Block Values from BlockState Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/bukkitutil/block/BlockCompat Deprecated method to get block values from a BlockState. It is recommended to use getBlockValues(BlockData) instead. This method is scheduled for removal. ```Java @Deprecated(since = "2.8.4", forRemoval = true) @Nullable BlockValues getBlockValues(org.bukkit.block.BlockState block) ``` -------------------------------- ### CommandHelp Class Constructors Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/command/CommandHelp Constructors for the CommandHelp class. The first constructor takes a command string and an array of SkriptColors for arguments. The second constructor additionally accepts a language node string. ```APIDOC CommandHelp(String[] command, SkriptColor[] argsColor) - Initializes a new CommandHelp object with the specified command and argument colors. CommandHelp(String[] command, SkriptColor[] argsColor, String[] langNode) - Initializes a new CommandHelp object with the specified command, argument colors, and language node. ``` -------------------------------- ### Skript Entity Matching Example Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/entity/PigData Demonstrates how to check if an entity is a pig or a saddled pig in Skript. This example highlights the use of entity matching within Skript. ```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 ``` -------------------------------- ### Skript Bukkit Syntax Event Builder API Documentation Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/bukkit/registration/BukkitSyntaxInfos.Event.Builder Provides a comprehensive overview of the BukkitSyntaxInfos.Event.Builder methods for customizing Skript event documentation. This includes methods for managing required plugins, 'since' versions, descriptions, events, examples, and keywords. ```APIDOC BukkitSyntaxInfos.Event.Builder: addRequiredPlugins(plugins: String...) Adds required plugins to the event's documentation. Parameters: plugins: A variable number of plugin names (String). addRequiredPlugins(plugins: Collection) Adds required plugins to the event's documentation. Parameters: plugins: A collection of plugin names (Collection). addSince(since: String) Adds a 'since' value to the event's documentation. Parameters: since: The version string (String). addSince(since: String...) Adds an array of 'since' values to the event's documentation. Parameters: since: A variable number of version strings (String...). addSince(since: Collection) Adds a collection of 'since' values to the event's documentation. Parameters: since: A collection of version strings (Collection). build(): BukkitSyntaxInfos.Event Builds a new syntax info from the set details. Returns: The constructed BukkitSyntaxInfos.Event object. clearDescription() Removes all description lines from the event's documentation. clearEvents() Removes all events from the event's documentation. clearExamples() Removes all examples from the event's documentation. clearKeywords() Removes all keywords from the event's documentation. ``` -------------------------------- ### ReleaseChannel API Documentation Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/update/ReleaseChannel API documentation for the ReleaseChannel class. This includes details on its constructor and methods, outlining their parameters, return types, and functionality. ```APIDOC Class ReleaseChannel Allows checking whether releases are in this channel or not. Constructor Summary: ReleaseChannel(Function checker, String name) checker: A function that takes a release string and returns a boolean indicating if it belongs to the channel. name: The name of the release channel. Method Summary: boolean check(String release) Checks whether the release with given name belongs to this channel. Parameters: release: The name of the release to check. Returns: true if the release belongs to the channel, false otherwise. String getName() Gets release channel name. Returns: The name of the release channel. ``` -------------------------------- ### Skript Entity Matching Example Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/entity/DroppedItemData Demonstrates how to check if an entity matches specific EntityData in Skript. It shows a practical example of using the 'is' condition with entity types. ```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 ``` -------------------------------- ### SkriptConfig Constructor and Methods Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/SkriptConfig Provides details on the SkriptConfig constructor and key methods. The constructor initializes the SkriptConfig object. Methods include retrieving an event registry, formatting timestamps into strings, and accessing the current configuration object. ```APIDOC SkriptConfig(): Initializes a new SkriptConfig object. eventRegistry(): Returns an EventRegistry for the configuration's events. - Returns: An event registry for the configuration's events. formatDate(long timestamp): Formats a given timestamp into a String representation. - Parameters: - timestamp: The long integer representing the timestamp. - Returns: A String representation of the formatted date. getConfig(): Retrieves the current Config object. - This method should only be used in special cases. - Returns: The current Config object, or null if not available. ``` -------------------------------- ### Skript Entity Matching Example Source: https://docs.skriptlang.org/javadocs/ch/njol/skript/entity/TropicalFishData This example demonstrates how to use Skript to spawn an entity and then check if it matches specific criteria, such as being a saddled pig. It highlights the `match` functionality. ```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 ``` -------------------------------- ### ExperimentSet Constructors and Methods Source: https://docs.skriptlang.org/javadocs/org/skriptlang/skript/lang/experiment/ExperimentSet Details the constructors and methods available for the ExperimentSet class. This includes information on how to instantiate the class and the various operations it supports. ```APIDOC ExperimentSet: __init__() Constructs a new ExperimentSet. addExperiment(experiment: Experiment) Adds an experiment to the set. Parameters: experiment: The Experiment object to add. getExperiments(): List Retrieves all experiments from the set. Returns: A list of Experiment objects. removeExperiment(experiment: Experiment) Removes an experiment from the set. Parameters: experiment: The Experiment object to remove. size(): int Returns the number of experiments in the set. Returns: The size of the set. ```