• Recently Browsing

    No registered users viewing this page.

  • Posts

    • Block right click takes precedence over item right click. Since the flower pot has a right-click action onItemUse never executes. You need to use onItemUseFirst, which is called before block right click.   This does not make sense and will in fact be true for any block that doesn't have properties, because it's just comparing to an empty list...
    • Hello,   I posted this same question yesterday in regards to Minecraft 1.12 and was told that 1.12 is no longer supported and I will need to upgrade to a newer version. Given that 1.14 is in LTS and the next closest version I will begin upgrading to that. However, the question posed in the original thread remains the same even if on a new version of Minecraft and I may as well try to get ahead of the ball. I have quoted the original post below but fellow readers should be aware that all the links other than the OpenGL docs link link to resources for 1.12. I have left the links in as I'm not sure how useful they will or won't be to future readers of this thread.  
    • Hello,   I wanted to be able to put a flower created by me in a flower pot. After realising I have to add a new flower pot with my modded flower and change the onItemUse method I got some issues. Here is my code of the new onItemUse method: public ActionResultType onItemUse(ItemUseContext context) { ItemStack stack = context.getItem(); World world = context.getWorld(); if(stack.getItem()==ItemList.censored_flower) { BlockState state = world.getBlockState(context.getPos()); if(state.getProperties().equals(Blocks.FLOWER_POT.getDefaultState().getProperties())) { world.setBlockState(context.getPos(), BlockList.censored_flower_pot.getDefaultState()); stack.setCount(stack.getCount()-1); return ActionResultType.SUCCESS; } if(state.getBlock()==Blocks.GRASS_BLOCK||state.getBlock()==Blocks.DIRT) { BlockPos pos = new BlockPos(context.getHitVec()); if(world.getBlockState(pos).getBlock()==Blocks.AIR) { world.setBlockState(pos, BlockList.censored_flower.getDefaultState()); stack.setCount(stack.getCount()-1); return ActionResultType.SUCCESS; } } } logger.info("Fail."); return ActionResultType.FAIL; }   So my problem is that the method doesn't seem to register when I rightclick on an empty flower pot while holding my flower. I also tried it with state.getBlock()==Blocks.FLOWER_POT but that didn't work either. The placement on grass and dirt blocks works perfectly. I believe the solution will be easy but I can't find it.   Thank you very much in advance.
    • 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
    • I'm trying to draw an overlay over one of the hotbar icons whenever a specific condition is met (e.g. you're holding a stick and you're pointing it to a block). So I'm listening to the RenderGameOverlayEvent.Post event, checking if the event type is HOTBAR, and then drawing the overlay if needed:     However, the overlay gets drawn behind the hotbar, as it the hotbar was being rendered after it. Check this clip: https://imgur.com/a/HJCtrnM   Using a different event type like ALL, which gets posted to the event bus later in time, seems to be a workaround in Forge 31.0.14, but in Forge 31.1.16 it still fails, though differently (the overlay renders correctly at first, but it eventually goes behind the hotbar item icon).   This same piece of code works fine in MC 1.14.4, and checking briefly (and with my very limited knowledge) the ForgeIngameGui file, I don't see why this is failing.   Am I missing anything, or is it a Forge bug? Thanks
  • Topics

  • Who's Online (See full list)