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.

heyitsmenobodyy

Members
  • Joined

  • Last visited

Everything posted by heyitsmenobodyy

  1. Updatetick and scheduleupdate aren't a thing apparently.
  2. What the title says. @Override public void onBlockPlacedBy(World worldIn, BlockPos pos, IBlockState state, EntityLivingBase placer, ItemStack stack) { if (!worldIn.isRemote) { worldIn.scheduleUpdate(pos, this, 20 * ModConfig.seconds); } } @Override public void updateTick(World worldIn, BlockPos pos, IBlockState state, Random rand) { if (!worldIn.isRemote) { worldIn.setBlockToAir(pos); worldIn.playSound(null, pos, SoundEvents.BLOCK_WOOD_BREAK, SoundCategory.BLOCKS, 0.6f, 1.2f); } } Will this not work anymore?
  3. Okay, I'm quite new to modding.. But i can't figure this one out, I want to listen for the EntityInteract event.. So far i've tried this: public class EntityInteract extends PlayerInteractEvent.EntityInteract { public EntityInteract(EntityPlayer player, EnumHand hand, Entity target) { super(player, hand, target); Main.logger.info("test"); } }
  4. How would i implement this in a block? Let's say i wanted to remove the block 10 seconds after it was placed.
  5. I need to interact with the game, Mind showing an example?
  6. How would you go about waiting? I thought about using Thread.sleep but that doesn't sound like the best idea.
  7. This is probably the simplest thing ever.. But how do edit a blocks breaking sound? Like glass.
  8. Thanks all of you for the help, I got it working now. package com.shoshonerp.shoshonerp.blocks; import com.shoshonerp.shoshonerp.Main; import com.shoshonerp.shoshonerp.init.ModBlocks; import com.shoshonerp.shoshonerp.init.ModItems; import com.shoshonerp.shoshonerp.util.Reference; import net.minecraft.block.Block; import net.minecraft.block.material.Material; import net.minecraft.block.state.IBlockState; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; 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 BlockBase extends Block { public BlockBase(String name, Material material) { super(material); this.setCreativeTab(Main.firsttab); this.setRegistryName(Reference.MOD_ID, name); this.setUnlocalizedName(this.getRegistryName().toString()); ModBlocks.BLOCKS.add(this); ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName())); } @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) { Main.logger.info("onBlockActivated called"); return true; } }
  9. I'm trying to get into minecraft modding.. But onBlockActivated just will not do anything. public class BlockBase extends Block implements IHasModel { public BlockBase(String name, Material material) { super(material); setUnlocalizedName(name); setRegistryName(name); setCreativeTab(Main.firsttab); ModBlocks.BLOCKS.add(this); ModItems.ITEMS.add(new ItemBlock(this).setRegistryName(this.getRegistryName())); } @Override public void registerModels() { Main.proxy.registerItemRenderer(Item.getItemFromBlock(this), 0, "inventory"); } public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { if (!worldIn.isRemote) { return false; } playerIn.sendMessage(new TextComponentString("test: " + playerIn.getDisplayNameString())); Main.logger.warn("Right click"); return true; } }

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.