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.
  • Joined

  • Last visited

Everything posted by [email protected]

  1. For the getTileEnityt method i cant find how to do that: if(worldIn.getTileEntity(pos) == BlockPos)?
  2. under write and read method how do i make it store up to 9 items?
  3. How would i write the item im holding to the tile entity?
  4. personally i dont want mine to hahve a gui (only insert item into chest right clicked with an item). Thank you!
  5. I have before made a chest in 1.12.2 but i think that it has changed since then so im not sure on how to make one in 1.16. Any help would be appriciated!
  6. Lollypoplove08/1.16.4-Kitchen-Mod: A Kitchen Mod made by SantaPexie (github.com)
  7. It works when i do if(player.inventory.getCurrentItem() == ItemInit.FLOUR.get()) though
  8. as in: public static void main(String[] args) { getList(); }
  9. if (canMix.contains(itemstack.getItem())) { player.getHeldItemMainhand().shrink(1); } private static HashSet<Item> canMix = new HashSet<Item>(); public static HashSet<Item> getList() { canMix.add(ItemInit.FLOUR.get()); return canMix; } why wont that work
  10. I have a block (bowl) that when you right click it with certain items (ItemInit.FLOUR, Items.EGG) it changes model but i cant figure out how to actually make code continue when you right clicked it with the certain items, i could manually do each one but i want a list or smth to make it easier
  11. public static void init() { CHANCES.defaultReturnValue(-1.0F); float f = 0.3F; float f1 = 0.5F; float f2 = 0.65F; float f3 = 0.85F; float f4 = 1.0F; registerCompostable(0.3F, Items.JUNGLE_LEAVES); registerCompostable(0.3F, Items.OAK_LEAVES); registerCompostable(0.3F, Items.SPRUCE_LEAVES); } private static void registerCompostable(float chance, IItemProvider itemIn) { CHANCES.put(itemIn.asItem(), chance); } public static final Object2FloatMap<IItemProvider> CHANCES = new Object2FloatOpenHashMap<>(); Looking trough the composter class i found this. Is that a good way to do it?
  12. I was changing the <object> thing around like an IItemProvider and a <Item> the error saying unlikely argument types came up but im not sure how i would fix it in theis case
  13. Im not sure why this is not working and i would appricate any help. I want (like a composter) for items in a hashset or a list to do .contains(player.inventory.getCurrentItem()) so the code will only run when you are holding the certain tems. My code so far is this: private static HashSet<Object> canMix = new HashSet<Object>(); public static HashSet<Object> getList() { canMix.add(ItemInit.FLOUR.get()); canMix.add(Items.ACACIA_BOAT); return canMix; } @SuppressWarnings("deprecation") @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if(handIn.MAIN_HAND == handIn) { if(!worldIn.isRemote) { if (player.inventory.getCurrentItem() != null) { if (canMix.contains(player.inventory.getCurrentItem())) { player.getHeldItemMainhand().shrink(1); } } else { return super.onBlockActivated(state, worldIn, pos, player, handIn, hit); } } return ActionResultType.SUCCESS; } return super.onBlockActivated(state,worldIn,pos,player,handIn,hit); }
  14. THanks! I did if(handIn.MAIN_HAND == handIn) and it worked!
  15. I wont lol. Do you use if(handIn.MAIN_HAND != null) {}
  16. How do i only make one hand fire then as it gives errors if i get rid of one
  17. when i use onblockactivated on a block class it fires twice, i thought it could be to do @Override public ActionResultType onBlockActivated(BlockState state, World worldIn, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) { if(!worldIn.isRemote) { if (player.inventory.getCurrentItem() != null) { if(player.inventory.getCurrentItem().getItem() == ItemInit.FLOUR_PAPER_BAG.get()) { System.out.println("POO"); player.entityDropItem(new ItemStack(ItemInit.FLOUR.get()), 1.0f); player.entityDropItem(new ItemStack(ItemInit.PAPER_BAG.get()), 1.0f); player.getHeldItemMainhand().shrink(1); } } with client and server so i my if(!world.isRemote) and it still didnt work. Any help would be appriciated!
  18. The hitbox is just the bottom part so like a stone cutter
  19. I made a new block where the hitbox and model changes rotation where you place it but the textures touching the hitbox are just black. I know the texture works as the particles lok the same but i dont know what im doing wrong. Also, no error comes up. My github project if it helps: Lollypoplove08/1.16.4-Kitchen-Mod: A Kitchen Mod made by SantaPexie (github.com)
  20. @Override public ActionResult<ItemStack> onItemRightClick(World world, PlayerEntity playerIn, Hand handIn) { if() { } PlayerEntity player = playerIn; player.entityDropItem(new ItemStack(ItemInit.FLOUR.get()), 1.0f); player.entityDropItem(new ItemStack(ItemInit.PAPER_BAG.get())); playerIn.getHeldItemMainhand().shrink(1); playerIn.container.detectAndSendChanges(); return super.onItemRightClick(world, playerIn, handIn); } on line 3 i want the code only to execute when it is right clicked on a certain block but im not sure on how i would do that
  21. Where does it say if the block you right clicked is "the speperator", //code
  22. I have a block called "the Separator" and i want it to drop two of my custom items in from of it when it gets right clivked with a bag_of_flour. I have make the onItemRightClick but after that im unsure on how to do the rest. Any help will be appriciated. Thanks :)

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.