Jump to content

TechnoSam

Members
  • Posts

    3
  • Joined

  • Last visited

Everything posted by TechnoSam

  1. Oh wow, I didn't even think about that. Thanks a bunch! I added the hand to the chat message so I could investigate what was going on. It seems like it triggers once for each hand in almost all scenarios. It triggers with only the main hand when right clicking with a block in the main hand. With a block in the off hand, it still triggers once for each hand. I can't manage to get only off hand. What's the logic there? If I place a block from my off hand, wouldn't I want to only get one event? It seems like that makes it impossible to build an action that happens only when clicking with the off hand. (Not that I want to do that, I'm just trying to understand how the system works.)
  2. I'm brand new to Forge and Minecraft modding, never done anything like this before. As a test, I wanted to just print a message when the player clicks a dirt block. I created a simple block class: public class BlockLogger extends Block { private static final Logger LOGGER = LogManager.getLogger(); public BlockLogger(Properties properties) { super(properties); } @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if (!worldIn.isRemote()) { LOGGER.warn("Clicked!"); player.sendMessage(new StringTextComponent("Clicked!")); } return super.onBlockActivated(state, worldIn, pos, player, handIn, hit); } } I registered the block in the root class of my mod with the following: Registry.register(Registry.BLOCK, "dirt", new BlockLogger(Block.Properties.create(Material.EARTH, MaterialColor.DIRT).hardnessAndResistance(0.5F).sound(SoundType.GROUND))); Running this, if I right-click the block with an open hand or a tool, I get two "Clicked!" messages. If I right-click the block with another place-able block, I get only one message like I expect. This behavior persists regardless of whether or not I call the parent's onBlockActivated method, but that's not surprising, it doesn't seem that the parent does anything other than returning PASS. What's going on here? I don't suspect a client / server issue since it does work with a place-able block. Have I registered it wrong? Is this just entirely the wrong way to do this? Or is this intended behavior? Thanks.
  3. So I updated to MC1.5 and downloaded the latest version, 7.7.0.582. I'm on a Mac, so I installed it by expanding the minecraft.jar, copying the files, choosing "replace", and zipping it back into a JAR. This has worked for all previous versions of Forge. However, I can't get past the Mojang screen. I think it may have something to do with the fact that my old "mods" "coremods" etc folders did not disappear when I updated. I used to be receiving a fatal error, but that went away when I removed all of my mods and coremods from their respective folders. Does anyone know why this doesn't work? I don't have a crash log because nothing crashes. Is there somewhere I should go to get some sort of report? --EDIT-- I did delete META-INF, and double-checked to make sure that it was gone.
×
×
  • Create New...

Important Information

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