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.

DjCtavia

Members
  • Joined

  • Last visited

  1. Well, get it, but in my Storage, how should I WriteNBT() and ReadNBT() ? There is a lot of NBT type, or maybe there is another way ? (Sorry to waste your time, look like understand nothing, but I really don't understand how to use correctly everything of Capabilities, I have created one for money who work very well, but when I want to doing with slot, that like I'm loosing every landmark.)
  2. Should I do a new interface who extends "IItemHandler" then ? Really, I don't see what class does I need, and how tu use it... I tried, but really I'm doing it really bad...
  3. Hello guys, well, I have a huge problem I can't answer with searching on forum or with Doc forge. I want to do a custom Inventory player, but for that I need to create a capability for stock this "inventory". Then I checked the doc here : https://mcforge.readthedocs.io/en/latest/datastorage/capabilities/ but, either I do not understand, or something is missing... (But I think I do not understand, I have a basic English, I find) Then, the best I can do is to show you what I already do, and what I do wrong. CapabilityHandler.class : CustomInventoryProvider.class : CommonProxy.class : Error on CommonProxy : line : "CapabilityManager.INSTANCE.register(IItemHandler.class, new IItemHandler(), IItemHandler.class);" Well, I hope there is everything you need for helping me ! I think there is so much things to change, but if I can understand where from the problem, that could be very cool. Thank you
  4. Hey, thank you for the answer, I hoped to not do that, but yes I guess I need to do this... I started to created different files for what I need. I tell you later if i'm doing it right
  5. Hi boys, well, I'm actually making a custom inventory for player, but I have only one trouble, I can't find a way to resize the slot. They are too bigger for my UI and I won't made my UI more bigger. That kill the gameplay of my mod. I checked everywhere on PlayerInventory, and container, I find nothing look like what I want. Thank you !
  6. Hi guys, well I have some trouble today, I was looking for some changement, something from regular minecraft, but a problem hurt me. I checked in the most files for find the render of enchantment, but I didn't find it, if someone have a kind of idea, that could be awesome ! Thank you
  7. I get this one, for side "client" and "server", but if I really understand (cause I could be wrong -> fact: I'm French). The problem only coming cause the player Right click on block, but there is 2 state of the right click, when he does the action, and when he stop, am I right ? EDIT : finaly I get the problem thank you guys, I get it. I change the primary condition like: if (!worldIn.isRemote && hand == enumHand.MAIN_HAND) { // Do stuff }
  8. I don't get this, how call only "client", what way I need to use for it ? And I don't understand the notion of "mainhand" and "offhand", it is like "player start to touch block " ?
  9. I don't see anything too do with EnumHand for my problem, I check the different purpose proposed but... I don't get it.
  10. I hope it's clean for reading. @Override public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, @Nullable ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ) { boolean buttonsFind = false; boolean elevatorFind = false; int elevatorBlockPos = 0; BlockPos finale; if (!worldIn.isRemote) { // Pour descendre en étant accroupi if (playerIn.isSneaking()) { for (int i = 2; i != 256; i++) { finale = new BlockPos(pos.getX(), pos.getY() - i, pos.getZ()); if (worldIn.getBlockState(finale).getBlock() == ModBlocks.elevatorButtonBlock) { buttonsFind = true; break; } } for (int y = 2; y != 256; y++) { finale = new BlockPos(MathHelper.floor_double(playerIn.getPosition().getX()), MathHelper.floor_double(playerIn.getPosition().getY()) - y, MathHelper.floor_double(playerIn.getPosition().getZ())); if (worldIn.getBlockState(finale).getBlock() == ModBlocks.elevatorBlock) { elevatorFind = true; elevatorBlockPos = MathHelper.floor_double(playerIn.getPosition().getY()) - y + 1; break; } } if (buttonsFind && elevatorFind) { playerIn.setPositionAndUpdate(playerIn.posX, (double) elevatorBlockPos, playerIn.posZ); return true; } if (buttonsFind) { if (!elevatorFind) { playerIn.addChatComponentMessage(new TextComponentString("No Elevator Block below your feet.")); } } else { if (!elevatorFind) { playerIn.addChatComponentMessage(new TextComponentString("No Buttons Elevator Block detected down, or Elevator Block below your feet.")); } else { playerIn.addChatComponentMessage(new TextComponentString("No Buttons Elevator Block detected down.")); } } } else { for (int i = 2; i != 256; i++) { finale = new BlockPos(pos.getX(), pos.getY() + i, pos.getZ()); if (worldIn.getBlockState(finale).getBlock() == ModBlocks.elevatorButtonBlock) { buttonsFind = true; break; } } for (int y = 2; y != 256; y++) { finale = new BlockPos(MathHelper.floor_double(playerIn.getPosition().getX()), playerIn.getPosition().getY() + y, MathHelper.floor_double(playerIn.getPosition().getZ())); if (worldIn.getBlockState(finale).getBlock() == ModBlocks.elevatorBlock) { elevatorFind = true; elevatorBlockPos = MathHelper.floor_double(playerIn.getPosition().getY()) + y + 1; break; } } if (buttonsFind && elevatorFind) { playerIn.setPositionAndUpdate(playerIn.posX, (double) elevatorBlockPos, playerIn.posZ); return true; } if (buttonsFind) { if (!elevatorFind) { playerIn.addChatComponentMessage(new TextComponentString("No elevator Block above your feet.")); } } else { if (!elevatorFind) { playerIn.addChatComponentMessage(new TextComponentString("No elevator buttons detect above, and no elevator block above your feet too.")); } else { playerIn.addChatComponentMessage(new TextComponentString("No elevator buttons detect above.")); } } } } return false; }
  11. Hum, like re-use a block with right click. Cause in chat the block tell 2 times a message and it should tell just 1 time. I already do a "if (!worldIn.isRemote())" Here the code: if (!worldIn.isRemote) { if (buttonsFind) { if (!elevatorFind) { playerIn.addChatComponentMessage(new TextComponentString("No Elevator Block below your feet.")); } } else { if (!elevatorFind) { playerIn.addChatComponentMessage(new TextComponentString("No Buttons Elevator Block detected down, or Elevator Block below your feet.")); } else { playerIn.addChatComponentMessage(new TextComponentString("No Buttons Elevator Block detected down.")); } } } I think you don't need anything else, if needed I give the entire code
  12. Hi guys, I searched for a method to sleep or wait in program for millis or second, I find "Thread.Sleep()" but, this method is not the good one, the game could crash. Then I tried to find an issue with "Tick" but I didn't found too... Then if someone could help me for find a method to sleep my program for a while I appreciate. Thank you !
  13. Oh... Ok, I see, thank you a lot Draco18s for resolving a 1 hour problem in a second ahah
  14. Hi guys, well, I have some trouble on modding, that like maybe 1 hours i'm on and, I don't get It... Actually is my first time on modding but whatever. I tried to get number of player when using an item. Then I use like it: @Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand) { if (!worldIn.isRemote) { playerIn.addChatComponentMessage(new TextComponentString(worldIn.playerEntities.size())); } return super.onItemRightClick(itemStackIn, worldIn, playerIn, hand); } I absolutely know I can't do like this. I have some experience in C and then I tried something else like getting the last index of the list, but after I can't do anything with the "Int" I can't do the function "ToString()". Thank you for helping me

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.