Skip to content

Instantly share code, notes, and snippets.

@artillect
Created November 26, 2016 21:53
Show Gist options
  • Save artillect/fa5483f4874ac669514428abe902dd40 to your computer and use it in GitHub Desktop.
Save artillect/fa5483f4874ac669514428abe902dd40 to your computer and use it in GitHub Desktop.
package com.artillect.voltaics.item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.EnumHand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
public class ItemVoltimeter extends ItemBase {
public ItemVoltimeter() {
super("voltimeter", true);
this.setMaxStackSize(1);
}
public boolean onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
if (worldIn.isRemote) {
player.addChatMessage(new TextComponentString(" X: "+ pos.getX() + " Y: " + pos.getY() + " Z: " + pos.getZ()));
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment