Class LootContextWrapper
java.lang.Object
org.skriptlang.skript.bukkit.loottables.LootContextWrapper
Wrapper for a LootContext.Builder to allow easier creation of LootContexts.
-
Constructor Summary
ConstructorDescriptionLootContextWrapper
(@NotNull org.bukkit.Location location) Creates a new LootContextWrapper at the given location. -
Method Summary
Modifier and TypeMethodDescriptionorg.bukkit.loot.LootContext
Gets the LootContext from the wrapper.@Nullable org.bukkit.entity.Entity
Gets the entity of the LootContext.@Nullable org.bukkit.entity.Player
Gets the killer of the LootContext.org.bukkit.Location
Gets the location of the LootContext.float
getLuck()
Gets the luck of the LootContext.void
setEntity
(@Nullable org.bukkit.entity.Entity entity) Sets the entity of the LootContext.void
setKiller
(@Nullable org.bukkit.entity.Player killer) Sets the killer of the LootContext.void
setLocation
(@NotNull org.bukkit.Location location) Sets the location of the LootContext.void
setLuck
(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.
-