Class LootContextWrapper
java.lang.Object
org.skriptlang.skript.bukkit.loottables.LootContextWrapper
Wrapper for a LootContext.Builder to allow easier creation of LootContexts.
-
Constructor Summary
ConstructorsConstructorDescriptionLootContextWrapper(@NotNull org.bukkit.Location location) Creates a new LootContextWrapper at the given location. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.loot.LootContextGets the LootContext from the wrapper.@Nullable org.bukkit.entity.EntityGets the entity of the LootContext.@Nullable org.bukkit.entity.PlayerGets the killer of the LootContext.org.bukkit.LocationGets the location of the LootContext.floatgetLuck()Gets the luck of the LootContext.voidsetEntity(@Nullable org.bukkit.entity.Entity entity) Sets the entity of the LootContext.voidsetKiller(@Nullable org.bukkit.entity.Player killer) Sets the killer of the LootContext.voidsetLocation(@NotNull org.bukkit.Location location) Sets the location of the LootContext.voidsetLuck(float luck) Sets the luck of the LootContext.
-
Constructor Details
-
LootContextWrapper
public LootContextWrapper(@NotNull @NotNull org.bukkit.Location location) Creates a new LootContextWrapper at the given location.- Parameters:
location- the location of the LootContext.
-
-
Method Details
-
getContext
public org.bukkit.loot.LootContext getContext()Gets the LootContext from the wrapper.- Returns:
- the LootContext.
-
setLocation
public void setLocation(@NotNull @NotNull org.bukkit.Location location) Sets the location of the LootContext.- Parameters:
location- the location.
-
setKiller
public void setKiller(@Nullable @Nullable org.bukkit.entity.Player killer) Sets the killer of the LootContext.- Parameters:
killer- the killer.
-
setEntity
public void setEntity(@Nullable @Nullable org.bukkit.entity.Entity entity) Sets the entity of the LootContext.- Parameters:
entity- the entity.
-
setLuck
public void setLuck(float luck) Sets the luck of the LootContext.- Parameters:
luck- the luck value.
-
getLocation
public org.bukkit.Location getLocation()Gets the location of the LootContext.- Returns:
- the location.
-
getKiller
@Nullable public @Nullable org.bukkit.entity.Player getKiller()Gets the killer of the LootContext.- Returns:
- the killer.
-
getEntity
@Nullable public @Nullable org.bukkit.entity.Entity getEntity()Gets the entity of the LootContext.- Returns:
- the entity.
-
getLuck
public float getLuck()Gets the luck of the LootContext.- Returns:
- the luck value.
-