# The code

"core" has a bunch of methods you can use:

{% tabs %}
{% tab title="Free Version" %}
```javascript
core.teleport(Entity, double, double, double) // (Entity) entity to teleport (double) x (double) y (double) z.
core.teleport(Entity, Entity) // (Entity) entity to teleport (Entity) entity tp teleport to.
core.setRotation(Entity, double, double) // (Entity) entity to rotate (double) yaw (double) pitch.
core.onlinePlayers() // Array of the online players.
core.getPlayerByName(String) // (String) the name of the player that you want to get.
core.getPlayerByUUID(String/UUID) // (String) the uuid of the player that you want to get as string (UUID) same but as UUID.
core.getNearbyEntities(Player, double, double, double) // (Player) the player (double) radius x (double) radius y (double) radius z.
core.getEntityById(World, int) // (World) the world of the entity (you can use player.getLocation().getWorld() to get the player's current world) (int) the id.
core.getEntityByUUID(World, String) // Same as before but with UUID as a String.
core.summonEntity(World, String (type), double, double, double) // (World) the world you want to spawn it in (String (type)) the entity type as String (double) x (double) y (double) z.
core.damage(Entity, double) // (Entity) the entity to damage (double) the amount of damage.
core.damage(Entity, double, Entity) // Same as before but (Entity(the last one) is the damage dealer).
core.getItemStack(Item) // (Item) the item you want to get his itemstack (using the default variable "item" will give you the current used item itemstack).
core.getWorld(String) // (String) world name.
core.getBlockAt(Location location) // (Location) the location of the block you want to get.
core.getBlockAt(World, double, double, double) // (World) the world of the block you want to get (double) x (double) y (double) z.
core.createExplosion(World, double, double, double, int) // (World) the world you want to create the explosion in (double) x (double) y (double) z (int) the power of the explosion.
core.createExplosion(Location, int) // (Location) the location that you want to create the explosion in (int) the power of the explosion.
core.getMaterial(String) // (String) the material name.
core.createParticle(World, double, double, double, String, int, int, int) // (World) the world that you want to create the particle in (double) x (double) y (double) z (String) particle name (int) speed (int) amount (int) how much time it will last for (in ticks, 20 ticks = 1 second).
core.createParticle(Location, String, int, int, int) // (Location) the location that you want to create the particle in (String) particle name (int) speed (int) amount (int) how much time it will last for (in ticks, 20 ticks = 1 second).
core.createRunnable(String) // (String) the code that you want to run when the runnable will run.
core.cancelEvent(Cancellable) // (Cancellable) the event that you want to cancel.
core.createLocation(World, double, double, double) (World) the location world (dobule) x (double) y (double) z.
core.getSound(String) // (String) sound name.
core.shootArrow(Player) // (Player) the player that will lunch the arrow, method also returns the Arrow class to modify.
core.playerHead(String) // Returns item with the head of the player with the name you specified (String) the player name.
core.playerHead(String, ItemStack) // Same as the method above but instead of creating new item it will change an existing item.
core.showPlayer(Player) // (Player) the player to show.
core.showPlayer(Player, long) // (Player) the player to show for (long (1000 = 1 second)).
core.hidePlayer(Player) // (Player) the player to hide.
core.hidePlayer(Player, long) // (Player) the player to hide for (long (1000 = 1 second)).
core.getCurrentTimeMs() // Will return the current uptime in ms.
core.color(String), core.colorString(String) for premium // (String) the colored string (using minecraft color codes (for example: "&ctest" will return "test" but in red)) Will return a colored string.
core.splashDamage(Player, double, double, double) // (Player) the player that will do the damage (double) the damage (double) radius x (double) radius y (double) radius z.

// Global variables (Can be used from any item code)
core.getGlobalVariable(String) // (String) the variable that you want to get its value.
core.setGlobalVariable(String, Object) // (String) the variable that you want to set its value (Object) the new value.

// Vault plugin required.
core.balance(Player) // (Player) Get the player's current balance (in double)
core.deposit(Player, double) // (Player) the player to deposit (double) the amount to deposit (will return boolean -> false if failed, true if succeeded).
core.withdraw(Player, double) // (Player) the player to withdraw (double) the amount to withdraw (will return boolean -> false if failed, true if succeeded).

// Hooks (Go to the hooks page to learn more.)
core.setHook(String, String, String, String)
core.getClassByName(String) // (String) the name of the class you want to get
```
{% endtab %}

{% tab title="Premium Version" %}
```javascript
core.teleport(Entity, double, double, double) // (Entity) entity to teleport (double) x (double) y (double) z.

core.teleportToEntity(Entity, Entity) // (Entity) entity to teleport (Entity) entity tp teleport to.

core.teleportToLocation(Entity, Location) // (Entity) entity to teleport (Location) the location to teleport to

core.setRotation(Entity, double, double) // (Entity) entity to rotate (double) yaw (double) pitch.

core.onlinePlayers() // Array of the online players.

core.getPlayerByName(String) // (String) the name of the player that you want to get.

core.getPlayerByUUID(String) // (String) the uuid of the player that you want to get as string

core.getPlayerByUUID(UUID) // (UUID) same as String but as UUID.

core.getNearbyEntities(Player, double, double, double) // (Player) the player (double) radius x (double) radius y (double) radius z.

core.getEntityById(World, int) // (World) the world of the entity (you can use player.getLocation().getWorld() to get the player's current world) (int) the id.

core.getEntityByUUID(World, String) // Same as before but with UUID as a String.

core.summonEntity(World, String (type), double, double, double) // (World) the world you want to spawn it in (String (type)) the entity type as String (double) x (double) y (double) z.

core.damage(Entity, double) // (Entity) the entity to damage (double) the amount of damage.

core.damageWithAttacker(Entity, double, Entity) // Same as before but (Entity(the last one) is the damage dealer).

core.getItemStack(Item) // (Item) the item you want to get his itemstack (using the default variable "item" will give you the current used item itemstack).

core.getWorld(String) // (String) world name.

core.getBlockAt(Location location) // (Location) the location of the block you want to get.

core.getBlockAtByLocation(World, double, double, double) // (World) the world of the block you want to get (double) x (double) y (double) z.

core.createExplosion(World, double, double, double, int) // (World) the world you want to create the explosion in (double) x (double) y (double) z (int) the power of the explosion.

core.createExplosionByLocation(Location, int) // (Location) the location that you want to create the explosion in (int) the power of the explosion.

core.getMaterial(String) // (String) the material name.

core.createParticle(World, double, double, double, ParticleDisplay, int, int, int) // (World) the world that you want to create the particle in (double) x (double) y (double) z (ParticleDisplay) the particle (int) speed (int) amount (int) how much time it will last for (in ticks, 20 ticks = 1 second).

core.createParticleByLocation(Location, ParticleDisplay, int, int, int) // (Location) the location that you want to create the particle in (ParticleDisplay) the particle (int) speed (int) amount (int) how much time it will last for (in ticks, 20 ticks = 1 second).

core.createRunnable(String) // (String) the code that you want to run when the runnable will run.

core.cancelEvent(Cancellable) // (Cancellable) the event that you want to cancel.

core.createLocation(World, double, double, double) (World) the location world (dobule) x (double) y (double) z.

core.getSound(String) // (String) sound name.

core.shootArrow(Player) // (Player) the player that will lunch the arrow, method also returns the Arrow class to modify.

core.newPlayerHead(String) // Returns item with the head of the player with the name you specified (String) the player name.

core.playerHead(String, ItemStack) // Same as the method above but instead of creating new item it will change an existing item.

core.showPlayer(Player) // (Player) the player to show.

core.showPlayerDuration(Player, long) // (Player) the player to show for (long (1000 = 1 second)).

core.hidePlayer(Player) // (Player) the player to hide.

core.hidePlayerDuration(Player, long) // (Player) the player to hide for (long (1000 = 1 second)).

core.getCurrentTimeMs() // Will return the current uptime in ms.

core.splashDamage(Player, double, double, double) // (Player) the player that will do the damage (double) the damage (double) radius x (double) radius y (double) radius z.

core.colorString(String) // (String) the colored string (using minecraft color codes (for example: "&ctest" will return "test" but in red)) Will return a colored string.

core.colorStrings(String) // Returns the core.colorString(String) in an array of 1 String.

core.colorComponent(String) // Returns core.colorString(String) as a BaseComponent

core.colorComponents(String) // Returns core.colorComponent(String) in an array of 1 BaseComponent

core.createEquation(String, String, String) // Create vector equation (String) equation x, (String) equation y, (String) equation z

core.shootProjectile(Player, Location, String, Object, int, Boolean, EquationVector) // !Blocks are still undeveloped! (Player) the shooter (Location) the start point (use player.getEyeLocation() most of the time), (String) the projectile type: ["particle", "item", "block"] (Object) the value based on the type: ParticleDisplay (using the particles category) or simply the particle name/item name/block name
// (int) Projectile time alive (in ticks) it will call the block hit event when destroyed (Boolean) does the item can splash hit (if it can hit all the entities in the same location) (EquationVector) The equation for the projectile movement (core.createEquation(String, String, String))

core.enableFly(Player) // (Player) the player to enable fly to, the player will be able to fly even in survival.

core.disableFly(Player) // (Player) the player to disable fly to, the player won't be able to fly anymore.

core.getSpecialVariable(ItemEvent, String) // (ItemEvent) The event that has the variable you want (you can just provide the "event" variable) (String) The variable name

core.doIf(Boolean, String) // (Boolean) Condition (String) The action as code

core.doIfElse(Boolean, String, String) // (Boolean) Condition (String) The action as code, (String) Else action

core.loop(String, int, int) // (String) The action as code (int) How much times to loop (put -1 for infinite) (int) Period in ticks | You can use the variable "tIndex" which is the current loop number

core.loopThrough(String, Array, int) // (String) The action as code (Array) the array to loop through (int) Period in ticks | You can use the variable "tIndex" which is the current loop number and the variable "currentArrayObject" which is the current array object

core.sendColorMessage(Player, String) // (Player) The player to send the message to (String) The message to send to the player (you can use color codes)

core.createVector(double, double, double) // (String) x (String) y (String) z, its Strings because it solves equations

core.setVelocity(Player, String, String, String) // (Player) Player to set his velocity (String) x (String) y (String) z, its Strings because it solves equations

core.setVelocityVec(Player, Vector) // (Player) Player to set his velocity (Vector) The new velocity

core.runRunnable(BukkitRunnable) // Run a runnable, can use core.createRunnable(String) to get BukkitRunnable

core.runCode(String) // Run code

core.runRunnableLater(BukkitRunnable, Int) // Run a runnable after some time in ticks, use core.createRunnable(String) to get BukkitRunnable

core.runCodeLater(String, Int) // Run code after some time in ticks

core.runUntil(String, String, Int) // (String) code to run, (String) condition that the loop will stop if its false, (Int) time between each loop in ms
// Will add the variable tIndex to the code, tIndex goes up for each loop

core.executeCommand(Player, String) // (Player) the player to execute the command, (String) the command to execute

core.removeHeldItem(Player) // this will remove the held item of the player, good for consumables so you can remove them on the onConsume trigger

core.giveItem(Player, Material) // this will create an item using a material and will give the item to the player, use core.getMaterial(String) to get the material.

core.heal(Player, Double) // heal the player with a specific amount

core.setGamemode(Player, String) // Set the gamemode of a player, (String is the gamemode name just like in /gamemode command

core.removeBlock(Block) // Remove the block

core.removeBlocks(Block[]) // Remove multiple blocks
  
core.getUsingIndex(Array, Int) // Get an object that is in the array using the  index he is placed in

core.addToLocation(Location, double, double, double) // Will add to the location to create a new location, for example if you add (1.0, 0.0, 0.0) to (48, 64, 100) it will turn into (49, 64, 100)

core.cloneLocation(Location) // Will return a copy of the location

core.setHealth(Player, double) // Set the player's health to a specific number

core.toString(Object) // Object is basically anything and it will return it as a string (text)

core.cast(Object, Class) // Cast the object to the specified class

core.toClass(String) // Get a class by name (need to use package too, for example, for string: "java.lang.String")

core.getIndex(Array, Object) // Will find the index of the object in the array, returns -1 if the object wasn't found

core.setInIndex(Array, Object, Int) // Put  the object in the array in the specified index (Int)

core.summonLightning(Location) // Summon a lightning at a specified location

core.summonLightning(World, double, double, double) // Will spawn a lightning in the specified world at the specified x, y, z

core.clearInventory(Player) // Will clear the player's inventory

core.changeBlockByMaterial(Block, Material) // (Block) the block to change is material (Material) the material to change it to

core.changeBlock(Block, String) // (Block) the block to change is material (String) the name of the material to change it to

core.getType(Block) // (Block) the block to get its material

core.getBlocksInRadius(Location, int, int, int) // (Location) the start location (int) the x radius (int) the y radius (int) the z radius

core.freeze(Player, Long) // (Player) the playe to freeze (Long) the duration in ticks (20 = 1 second)

core.breakBlockWithItem(Block, Item) // Will break the block and if the material of the item is strong enough it will drop too (like a normal block break)

core.breakBlock(Block) // Will break the block without checking for item material

core.getVariableFromEvent(Event, String) // Will return a variable value from an event (String) the variable name, can look for a name using the spigot wiki, for example for 'player' it will look for a variable named 'player' in the event and return its value

core.isNull(Object) // Returns true if the object is null and false if its isnt

core.getHelmet(Player) // Returns the ItemStack of the (Player) player's helmet (may be null)

core.getLeggings(Player) // Returns the ItemStack of the (Player) player's leggings (may be null)

core.getBoots(Player) // Returns the ItemStack of the (Player) player's boots (may be null)

core.hasId(ItemStack, String) // Returns true if the item has the id (String) (Id is set in the itemeditor, this function can be used for armor sets abilities, etc)

core.isTalistam(Item) // returns true if its a talisman and false if isn't

core.getItemStatValue(Item, String) // Will return a number of the value of the (String) stat name on (Item) items, 0 if doesn't exist






// Particles
particles.of(String) // Returns a ParticleDisplay with the particle of (String) particle name

particles.colored(int, int, int, float) // Returns a ParticleDisplay with the dust particle in the color (int) r (int) g (int) b, (float) size

particles.custom() // Coming soon...

particles.withLocation(ParticleDisplay, Location) // Adds location to a particle display (You need location for the new particle effects)

particles.withDirection(ParticleDisplay, Vector) // Adds direction to a particle display (Can be used for effects that may use direction)

// Ton of new particle effect taken from XSeries Particles (You can view explanations for the effects there)
// Some effects have been modified to take lifetime variable too, provided in ticks, the effect will stop playing after the chosen time.





// Global variables (Can be used from any item code)
core.getGlobalVariable(String) // (String) the variable that you want to get its value.

core.setGlobalVariable(String, Object) // (String) the variable that you want to set its value (Object) the new value.


// Player variables (Variables for each player)
core.getPlayerVariable(Player, String, Boolean) // (Player) The player you want the get his variable (String) the variable that you want to get its value, (Boolean) If the variable is temp (will get removed after server restart)

core.getPlayerVariableOrDefault(Player, String, Object, Boolean) // (Player) The player you want the get his variable (String) the variable that you want to get its value, (Object) if the variable isn't found set it to the default, (Boolean) If the variable is temp (will get removed after server restart)

core.setPlayerVariable(Player, String, Object) // (Player) The player you want to set his variable (String) the variable that you want to set its value (Object) the new value.


// Vault plugin required.
core.balance(Player) // (Player) Get the player's current balance (in double)

core.deposit(Player, double) // (Player) the player to deposit (double) the amount to deposit (will return boolean -> false if failed, true if succeeded).

core.withdraw(Player, double) // (Player) the player to withdraw (double) the amount to withdraw (will return boolean -> false if failed, true if succeeded).


// PlaceholderAPI plugin required.
core.parsePlaceholder(Player, String) // (Player) player, (String) the string that contains the placeholder, for example: "Hey, %player_name%!"


// Hooks (Go to the hooks page to learn more.)
core.setHook(String, String, String, String)

core.getClassByName(String) // (String) the name of the class you want to get


// Values methods
core.value(String) // Will parse the string to int / long / double / boolean

core.variable(String) // get variable by its name
```
{% endtab %}
{% endtabs %}

You also have the variables "player", "item", "values" and "api" by default, "player" is the player that used the item "item" is the item, "values" has some custom methods and "api" is the api class
