Jump to content

Luis_ST

Members
  • Posts

    5704
  • Joined

  • Last visited

  • Days Won

    72

Everything posted by Luis_ST

  1. use NetworkHooks#openGui look how minecraft create container, but basically you need the container and a screen tutorials are not the best solution to learn something, read the forge docs and look here in the forum, then try to create a container, if you have problems creating it you can still ask
  2. First of all, this is only possible on servers on which your mod is running and yes you have to send a packet, take a look at the forge doc (networking) if you've read the doc here is a practical example
  3. I created a custom command with custom argument. The command works but when I execute the part with my argument I get the following CommandException: [09:50:51] [Render thread/INFO] [minecraft/NewChatGui]: [CHAT] Expected whitespace to end one argument, but found trailing data [09:50:51] [Render thread/INFO] [minecraft/NewChatGui]: [CHAT] ...k set Dev bedwars:server_admin<--[HERE] what exactly does this error mean? this is my command class this is my command argument class
  4. look how minecraft does it, an example would be the fence block
  5. check if it's not the nether and the end
  6. your code looks good only that your item class does not contain a constructor, and your item that you register creates a normal item and not your "ender_staff" item
  7. "Help with modding goes in here, however, please keep in mind that this is not a Java school. You are expected to have basic knowledge of Java before posting here." Edit (after reading the post of @Soft-fur dragon: if you want to start with the moding read the forge doc
  8. do you know java? Expanding a class is one of the basics look here for a example: https://github.com/Luis-st/Forge-1.16.5-36.0.1-mdk/blob/main/src/main/java/net/luis/cave/common/item/FungusSoup.java
  9. if the class posted above is your complete class, it is clear that it is not working your class has to expand the item class in this class is the method that you have to overwrite (Item#addInformation) And Please follow Java naming conventions.
  10. can you post the complet class would be helpful
  11. this is not a forge mod
  12. is this complete code of your item class? if so, then an important part is missing
  13. ah okay i found the method that does it for me thanks
  14. I am currently working on a mod that enables the game mode Bedwars. now i want to improve my villager shop system, which currently consists of several villagers (with custom trades). I would now like to put this in one villager. for this I have created a custom container which should act as a shop. Items are placed in this container when it is opened. and the player can then switch back and forth in various tabs by clicking on items. And this is exactly where the problem is, I know that if I move items in a container, I have to synchronize them with the server. I do this with a SimpleChannel and a custom message. when I test the whole thing it doesn't work / it is like before without the synchronization, the items are not placed correctly in the slots because when I click into the inventory it resets to the default this is the container class this the message class and this a helper class which i use to set the items in the inventory so what's wrong? - thanks for replies
  15. new BlockItemUseContext.
  16. I use the PlayerSpawnEvent to teleport the player to a certain block and i get the position from a capability But now I get a NullPointerException on the server, client works without problems this is the repo (the class of the PlayerRespawnEvent) this is the log: latest.log
      • 1
      • Like
  17. 1.12 is no longer supported on this forum. Please update to a modern version of Minecraft to receive support.
  18. I'm not sure, but I think you can prevent/change it with the RenderGameOverlayEvent
  19. No, because with an event you can only change the damage currently caused but you could also change this with the RenderToolTipEvent if you don't want to do this, it would be better to overwrite the item (register it with the vanilla name and the mod id)
  20. the reflection would be an idea, but it would be easier to use an event and check whether the attacker is using a diamond sword tip: use the LivingDamageEvent you get the attacker from the DamageSource
  21. I think you should check the slots one by one. an example would be a for-loop (which checks the first 9 slots for obsidian 0-8 that would be the hotbar slots). note: if you want to change something in the inventory you cannot use Minecraft#getInstance#player because you get a client player here
  22. I think that's not possible because the damage from the arrow depends on the arrow velocity that mean if you increase the speed of the arrow, the damage is also increased Edit: check out the method onEntityHit in the AbstractArrowEntity class for more information
  23. I need the values in the following events WorldTick, PlayerTick, BlockBreakEvent, PlayerRespawnEvent and PlayerCloneEvent. the TickEvents are on the server just like the BlockBreakEvent. what about the other two events (PlayerRespawnEvent, PlayerCloneEvent) are these servers or clients? since if the two were also server events I wouldn't have to sync the values.
  24. yes do I have to synchronize the two values between server and client?
×
×
  • Create New...

Important Information

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