Skip to content

Instantly share code, notes, and snippets.

@akkez akkez/blockinfo_block.js

Last active Aug 29, 2015
Embed
What would you like to do?
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
You can’t perform that action at this time.