Class ExprSecCreateLootContext
java.lang.Object
ch.njol.skript.lang.util.SimpleExpression<org.bukkit.loot.LootContext>
ch.njol.skript.expressions.base.SectionExpression<org.bukkit.loot.LootContext>
org.skriptlang.skript.bukkit.loottables.elements.expressions.ExprSecCreateLootContext
- All Implemented Interfaces:
Debuggable
,Expression<org.bukkit.loot.LootContext>
,Loopable<org.bukkit.loot.LootContext>
,SyntaxElement
@Name("Create Loot Context")
@Description("Create a loot context.")
@Examples({"set {_player} to player","set {_context} to a loot context at player:","\tset loot luck value to 10","\tset looter to {_player}","\tset looted entity to last spawned pig","give player loot items of loot table \"minecraft:entities/iron_golem\" with loot context {_context}"})
@Since("2.10")
public class ExprSecCreateLootContext
extends ch.njol.skript.expressions.base.SectionExpression<org.bukkit.loot.LootContext>
-
Field Summary
Fields inherited from class ch.njol.skript.expressions.base.SectionExpression
section
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected org.bukkit.loot.LootContext @Nullable []
get
(org.bukkit.event.Event event) This is the internal method to get an expression's values.
To get the expression's value from the outside useSimpleExpression.getSingle(Event)
orSimpleExpression.getArray(Event)
.Class
<? extends org.bukkit.loot.LootContext> Gets the return type of this expression.boolean
init
(Expression<?>[] exprs, int pattern, Kleenean isDelayed, SkriptParser.ParseResult result, @Nullable SectionNode node, @Nullable List<TriggerItem> triggerItems) boolean
isSingle()
toString
(@Nullable org.bukkit.event.Event event, boolean debug) Methods inherited from class ch.njol.skript.expressions.base.SectionExpression
getAsSection, init, loadCode, loadCode, loadOptionalCode, runSection, setTriggerItems
Methods inherited from class ch.njol.skript.lang.util.SimpleExpression
acceptChange, change, check, check, check, getAll, getAnd, getArray, getConvertedExpr, getConvertedExpression, getSingle, getSource, getTime, isDefault, isLoopOf, iterator, setTime, setTime, setTime, setTime, setTime, simplify, supportsLoopPeeking, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface ch.njol.skript.lang.Expression
beforeChange, canBeSingle, canReturn, changeInPlace, changeInPlace, getAcceptedChangeModes, getOptionalSingle, getSyntaxTypeName, possibleReturnTypes, stream
Methods inherited from interface ch.njol.skript.lang.SyntaxElement
getParser
-
Constructor Details
-
ExprSecCreateLootContext
public ExprSecCreateLootContext()
-
-
Method Details
-
init
public boolean init(Expression<?>[] exprs, int pattern, Kleenean isDelayed, SkriptParser.ParseResult result, @Nullable @Nullable SectionNode node, @Nullable @Nullable List<TriggerItem> triggerItems) - Specified by:
init
in classch.njol.skript.expressions.base.SectionExpression<org.bukkit.loot.LootContext>
-
get
protected org.bukkit.loot.LootContext @Nullable [] get(org.bukkit.event.Event event) Description copied from class:SimpleExpression
This is the internal method to get an expression's values.
To get the expression's value from the outside useSimpleExpression.getSingle(Event)
orSimpleExpression.getArray(Event)
.- Specified by:
get
in classSimpleExpression<org.bukkit.loot.LootContext>
- Parameters:
event
- The event with which this expression is evaluated.- Returns:
- An array of values for this event. May not contain nulls.
-
isSingle
public boolean isSingle()- Returns:
- true if this expression will ever only return one value at most, false if it can return multiple values.
-
getReturnType
Description copied from interface:Expression
Gets the return type of this expression.- Returns:
- A supertype of any objects returned by
Expression.getSingle(Event)
and the component type of any arrays returned byExpression.getArray(Event)
-
toString
- Parameters:
event
- The event to get information from. This is always null if debug == false.debug
- If true this should print more information, if false this should print what is shown to the end user- Returns:
- String representation of this object
-