Everything posted by [email protected]
-
how to make a chest in 1.16 modding
For the getTileEnityt method i cant find how to do that: if(worldIn.getTileEntity(pos) == BlockPos)?
-
how to make a chest in 1.16 modding
under write and read method how do i make it store up to 9 items?
-
how to make a chest in 1.16 modding
How would i write the item im holding to the tile entity?
-
how to make a chest in 1.16 modding
personally i dont want mine to hahve a gui (only insert item into chest right clicked with an item). Thank you!
-
how to make a chest in 1.16 modding
A brief summary would be nice!
-
how to make a chest in 1.16 modding
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!
-
Trying to look for a hashset list in player.inventory.getCurrentItem()
Lollypoplove08/1.16.4-Kitchen-Mod: A Kitchen Mod made by SantaPexie (github.com)
-
Trying to look for a hashset list in player.inventory.getCurrentItem()
It works when i do if(player.inventory.getCurrentItem() == ItemInit.FLOUR.get()) though
-
Trying to look for a hashset list in player.inventory.getCurrentItem()
i dont think so
-
Trying to look for a hashset list in player.inventory.getCurrentItem()
as in: public static void main(String[] args) { getList(); }
-
Trying to look for a hashset list in player.inventory.getCurrentItem()
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
-
Trying to look for a hashset list in player.inventory.getCurrentItem()
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
-
Trying to look for a hashset list in player.inventory.getCurrentItem()
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?
-
Trying to look for a hashset list in player.inventory.getCurrentItem()
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
-
Trying to look for a hashset list in player.inventory.getCurrentItem()
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); }
-
OnBlockActivated fires twice
THanks! I did if(handIn.MAIN_HAND == handIn) and it worked!
-
OnBlockActivated fires twice
I wont lol. Do you use if(handIn.MAIN_HAND != null) {}
-
OnBlockActivated fires twice
How do i only make one hand fire then as it gives errors if i get rid of one
-
OnBlockActivated fires twice
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!
-
The hitbox seems to make the texture go black.
-
The hitbox seems to make the texture go black.
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)
-
Dropping an item only when clicked on certain block
@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
-
Dropping an item only when clicked on certain block
Where does it say if the block you right clicked is "the speperator", //code
-
Dropping an item only when clicked on certain block
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 :)
IPS spam blocked by CleanTalk.