Skip to content

Instantly share code, notes, and snippets.

@akkez
Last active August 29, 2015 14:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save akkez/ac409826b48ca55c98ca to your computer and use it in GitHub Desktop.
Save akkez/ac409826b48ca55c98ca to your computer and use it in GitHub Desktop.
importPackage(Packages.org.bukkit);
importPackage(Packages.com.sk89q.worldedit);
importPackage(Packages.com.sk89q.worldedit.blocks);
var w = player.getWorld();
var sel = context.getSession().getSelection(w);
var beg = sel.getMinimumPoint();
var x = beg.getBlockX();
var y = beg.getBlockY();
var z = beg.getBlockZ();
var block = Bukkit.getWorld("world").getBlockAt(x, y, z);
Bukkit.getLogger().info("block " + block.getType().toString() + ":" + block.getData() + "(" + block.getTypeId() + ")");
Bukkit.getPlayerExact(player.getName()).sendMessage("block " + block.getType().toString() + ":" + block.getData() + "(" + block.getTypeId() + ")");
importPackage(Packages.org.bukkit);
importPackage(Packages.com.sk89q.worldedit);
importPackage(Packages.com.sk89q.worldedit.blocks);
var bp = Bukkit.getPlayerExact(player.getName());
var is = bp.getItemInHand();
Bukkit.getLogger().info("item " + is.getType().toString() + ":" + is.getData().toString() + "(" + is.getTypeId() + ")");
Bukkit.getPlayerExact(player.getName()).sendMessage("item " + is.getType().toString() + ":" + is.getData().toString() + "(" + is.getTypeId() + ")");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment