public class CommonFunctions extends AbstractCommonFunctions implements SelfReference
plugin
Constructor and Description |
---|
CommonFunctions(TriggerReactorCore plugin) |
Modifier and Type | Method and Description |
---|---|
Collection<? extends org.bukkit.entity.Player> |
getPlayers()
get list of online players online
|
org.bukkit.inventory.ItemStack |
headForName(String targetName,
int amount)
Create a player head with given name.
|
org.bukkit.inventory.ItemStack |
headForValue(String textureValue)
Create a player head with given textureValue(base64 encoded).
|
org.bukkit.inventory.ItemStack |
item(int type,
int amount)
Deprecated.
|
org.bukkit.inventory.ItemStack |
item(int type,
int amount,
int data)
Deprecated.
use
item(String, int, int) instead |
org.bukkit.inventory.ItemStack |
item(String type,
int amount)
Create a new ItemStack
|
org.bukkit.inventory.ItemStack |
item(String type,
int amount,
int data)
Create a new ItemStack
|
org.bukkit.potion.PotionEffect |
makePotionEffect(String EffectType,
int duration,
int amplifier,
boolean ambient,
boolean particles,
org.bukkit.Color color)
create a PotionEffect for use in entity.addPotionEffect();
|
SerializableLocation |
serializeLocation(org.bukkit.Location loc)
Create a new SerializableLocation, which implements ConfigurationSerializable
|
SerializableLocation |
serializeLocation(org.bukkit.World world,
double x,
double y,
double z)
Create a new SerializableLocation, which implements ConfigurationSerializable
|
SerializableLocation |
serializeLocation(org.bukkit.World world,
double x,
double y,
double z,
double yaw,
double pitch)
Create a new SerializableLocation, which implements ConfigurationSerializable
|
boolean |
takeItem(org.bukkit.entity.Player player,
int id,
int amount)
Deprecated.
use
takeItem(Player, String, int) instead |
boolean |
takeItem(org.bukkit.entity.Player player,
int id,
int amount,
int data)
Deprecated.
use
takeItem(Player, String, int, int) instead |
boolean |
takeItem(org.bukkit.entity.Player player,
String id,
int amount)
take item from player.
|
boolean |
takeItem(org.bukkit.entity.Player player,
String id,
int amount,
int data)
take item from player.
|
addLore, block, bukkitColor, clearLore, color, currentArea, currentAreaAt, currentAreas, currentAreasAt, formatCurrency, formatCurrency, getEntitiesInArea, getItemTitle, getLore, getTargetBlock, hasLore, headForName, location, location, locationEqual, loreSize, oplayer, player, plugin, removeLore, setItemTitle, setLore, takeItem
array, arrayOf, list, listOf, map, matches, mergeArguments, mergeArguments, mergeArguments, newInstance, parseDouble, parseEnum, parseInt, random, random, random, random, random, random, random, random, round, set, set, slocation, sqrt, staticGetFieldValue, staticMethod, staticSetFieldValue, toByte, toDouble, toFloat, toInt, toLong, toShort, typeOf
public CommonFunctions(TriggerReactorCore plugin)
@Deprecated public boolean takeItem(org.bukkit.entity.Player player, int id, int amount)
takeItem(Player, String, int)
insteadExample) /trg run IF takeItem(player, 0, 1); #MESSAGE "Removed one stone."; ELSE; #MESSAGE "You don't have a stone"; ENDIF;
takeItem
in class AbstractCommonFunctions
player
- id
- amount
- public boolean takeItem(org.bukkit.entity.Player player, String id, int amount)
Example) /trg run IF takeItem(player, "STONE", 1); #MESSAGE "Removed one stone."; ELSE; #MESSAGE "You don't have a stone"; ENDIF;
You can find item names in MaterialtakeItem
in class AbstractCommonFunctions
player
- target playerid
- item idamount
- amount@Deprecated public boolean takeItem(org.bukkit.entity.Player player, int id, int amount, int data)
takeItem(Player, String, int, int)
insteadExample) /trg run IF takeItem(player, 0, 1, 1); #MESSAGE "Removed one granite."; ELSE; #MESSAGE "You don't have a granite"; ENDIF;
takeItem
in class AbstractCommonFunctions
player
- target playerid
- item idamount
- amountdata
- data of itempublic boolean takeItem(org.bukkit.entity.Player player, String id, int amount, int data)
Example) /trg run IF takeItem(player, "STONE", 1, 1); #MESSAGE "Removed one granite."; ELSE; #MESSAGE "You don't have a granite"; ENDIF;
You can find item names in MaterialtakeItem
in class AbstractCommonFunctions
player
- target playerid
- item idamount
- amountdata
- data of itempublic Collection<? extends org.bukkit.entity.Player> getPlayers()
Example) /trg run FOR p = getPlayers(); p.performCommand("spawn"); ENDFOR;
getPlayers
in class AbstractCommonFunctions
public org.bukkit.potion.PotionEffect makePotionEffect(String EffectType, int duration, int amplifier, boolean ambient, boolean particles, org.bukkit.Color color)
AbstractCommonFunctions
Example) /trg run player.addPotionEffect( makePotionEffect("SPEED", 1000000, 5, false, true, bukkitColor(21,2,24) ))
makePotionEffect
in class AbstractCommonFunctions
EffectType
- the name of the PotionEffectType to useduration
- how long the potioneffect should last when applied to an enitityamplifier
- how strong the effect should beambient
- if true particle effects will be more transparentparticles
- if false potion particle effects will not be showncolor
- use bukkitColor() or is no longer available since 1.13@Deprecated public org.bukkit.inventory.ItemStack item(int type, int amount, int data)
item(String, int, int)
insteadExample) /trg run #GIVE item(1, 64, 0)
item
in class AbstractCommonFunctions
type
- typeIdamount
- amount of itemdata
- datapublic org.bukkit.inventory.ItemStack item(String type, int amount, int data)
Example) /trg run #GIVE item("STONE", 64, 0)
item
in class AbstractCommonFunctions
type
- typeIdamount
- amount of itemdata
- data@Deprecated public org.bukkit.inventory.ItemStack item(int type, int amount)
Example) /trg run #GIVE item(1, 32)
item
in class AbstractCommonFunctions
type
- typeIdamount
- amount of itempublic org.bukkit.inventory.ItemStack item(String type, int amount)
Example) /trg run #GIVE item("STONE", 32)
item
in class AbstractCommonFunctions
type
- typeIdamount
- amount of itempublic org.bukkit.inventory.ItemStack headForName(String targetName, int amount)
AbstractCommonFunctions
Example) /trg run #GIVE headForName("wysohn")
headForName
in class AbstractCommonFunctions
targetName
- name of the owner of headamount
- amountpublic org.bukkit.inventory.ItemStack headForValue(String textureValue)
Example) /trg run #GIVE headForValue("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlc y5taW5lY3JhZnQubmV0L3RleHR1cmUvN2RjZDdkZjUyNjQ1YzY4Y2RhZDg1NDhlNjFiM2Y3 NjU5NjQwNzcyMjZiYTg3MmI5ZDJiZDQ1YzQzOWQifX19\\")
Notice that there is an extra \ sign as \ is an escape sequence. The final String will be ...OWQifX19\ instead of ...OWQifX19\\"
headForValue
in class AbstractCommonFunctions
textureValue
- base64 encoded texture valuepublic SerializableLocation serializeLocation(org.bukkit.World world, double x, double y, double z)
Example) /trg run serialized = serializeLocation("wildw", 2, 13, 44)
serializeLocation
in class AbstractCommonFunctions
world
- The world instance in which this location residesx
- The x-coordinate of this locationy
- The y-coordinate of this locationz
- The z-coordinate of this locationpublic SerializableLocation serializeLocation(org.bukkit.World world, double x, double y, double z, double yaw, double pitch)
Example) /trg run serialized = serializeLocation("wildw", 2, 13, 44.6, 13)
serializeLocation
in class AbstractCommonFunctions
world
- The world instance in which this location residesx
- The x-coordinate of this locationy
- The y-coordinate of this locationz
- The z-coordinate of this locationyaw
- The absolute rotation on the x-plane, in degreespitch
- The absolute rotation on the y-plane, in degreespublic SerializableLocation serializeLocation(org.bukkit.Location loc)
Example) /trg run serialized = serializeLocation("wildw", 2, 13, 44.6, 13)
serializeLocation
in class AbstractCommonFunctions
loc
- The Location value