Skip to content

Instantly share code, notes, and snippets.

@artillect
Created November 26, 2016 21:20
Show Gist options
  • Save artillect/84b8d5ec47b8e75727fd9c27f6e44b99 to your computer and use it in GitHub Desktop.
Save artillect/84b8d5ec47b8e75727fd9c27f6e44b99 to your computer and use it in GitHub Desktop.
Voltimeter item class
package com.artillect.voltaics.item;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TextComponentString;
import net.minecraft.world.World;
public class ItemVoltimeter extends ItemBase {
public ItemVoltimeter() {
super("voltimeter", true);
this.setMaxStackSize(1);
}
@Override
public boolean onItemUse(ItemStack itemstack, EntityPlayer entityplayer, World world,int x,int y,int z,int par7)
{
if (world.isRemote) {
entityplayer.addChatMessage(new TextComponentString(" X: "+ x + " Y: " + y + " Z: " + z));
}
return true;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment