Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ItemTest extends ItemNk{
- private String tip;
- public ItemTest() {
- super("test_item");
- }
- @Override
- @SideOnly(Side.CLIENT)
- public void addInformation(ItemStack stack, EntityPlayer playerIn, List<String> tooltip, boolean advanced) {
- if(!(tip==null)) {
- tooltip.add("\u00a7a" + tip);
- }
- }
- @Override
- public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
- tip = worldIn.getBlockState(pos).getBlock().getLocalizedName();
- if (!worldIn.isRemote) {
- playerIn.addChatMessage(new TextComponentString("Block set to " + tip));
- }
- return EnumActionResult.SUCCESS;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement