Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

mkkl

Members
  • Joined

  • Last visited

  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.

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.