The code
Last updated
Last updated
After you clicked on the "next" button you should be on this page:
Now you need to write the item code.
You can use "core" for special methods:
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
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, 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.createParticleByLocation(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.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.shootProjectile(Player, Location, String, String, 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"] (String) the value based on the type: 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 it (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.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" that is the current loop number
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)
createVector(double, double, double) // (String) x (String) y (String) z, its Strings because it solves equations
setVelocity(Player, String, String, String) // (Player) Player to set his velocity (String) x (String) y (String) z, its Strings because it solves equations
setVelocityVec(Player, Vector) // (Player) Player to set his velocity (Vector) The new velocity
// 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) // (Player) The player you want the get his variable (String) the variable that you want to get its value
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).
// 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
You also have the variables "player", "item" and "api" by default, "player" is the player that used the item "item" is the item the used "api" is the api class