Jump to content

mkkl

Members
  • Posts

    3
  • Joined

  • Last visited

mkkl's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Feel like an idiot now, but it confuses me becouse I have tried to even find onBlockActivated in block class and wasn't able to find it for some reason, and in docs there was itemstack as well. Anyway thanks for help, really appreciate it.
  2. package com.mkk.testmod.blocks.special.infuser; import com.mkk.testmod.init.ModBlocks; import com.mkk.testmod.init.ModItems; import net.minecraft.block.Block; import net.minecraft.block.ITileEntityProvider; import net.minecraft.block.SoundType; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.client.Minecraft; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; import net.minecraft.tileentity.TileEntity; import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumHand; import net.minecraft.util.math.BlockPos; import net.minecraft.world.World; public class Infuser extends Block implements ITileEntityProvider { //tried with this as well public Infuser(String name) { super(Material.IRON); setSoundType(SoundType.ANVIL); setHardness(3f); setResistance(7f); setLightLevel(10/16f); setLightOpacity(3); setHarvestLevel("pickaxe", 1); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(CreativeTabs.REDSTONE); ModBlocks.BLOCKS.add(this); ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName())); } @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (world.isRemote) { return true; } //some of my code return true; } public void registerModels() { Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory"); } @Override public TileEntity createNewTileEntity(World arg0, int arg1) { return new InfuserContainerTE(); } As you can see it's pretty basic because I want to first get rightclick work
  3. New in making minecraft mods here. For 2 days I have been trying to make block clickable by adding onBlockActiavted function (/event ?)(@Override included) to it, so I made new class extended it with block , of course it didn't work, so after some reasearch I have found that block don't have onBlockActivated in it so I tried with block.BlockContainer, but eclipse show me that there is no onBlockActivated in it. At this point I started to look on some examples of 1.12 mods and most of them use onBlockActivated with BlockContainer extended. I am asking for help because I can't continue with project without it. Thanks for any help.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.