Jump to content

Animefan8888

Forge Modder
  • Posts

    6157
  • Joined

  • Last visited

  • Days Won

    59

Everything posted by Animefan8888

  1. Take a look at those two classes. CompoundNBT and CompressedStreamTools. You can get the game directory by doing Minecraft.getInstance().gameDir but do note that this will not work on dedicated server. Here is an example where I have used GSON to write JSON files. Though it might be too complicated for an example.
  2. Not that kind of where, where is your code going to be located for this rendering operation?
  3. Then you are doing something wrong. public class MyEntity extends SomeEntity { public int timer = 0; public void damageEntity(DamageSource source, float damageAmount) { // DO STAT INCREASES timer = 300; } public void tick() { if (timer > 0) { timer--; if (timer == 0) { // DO OTHER STAT STUFF. } } } } That is an example. If you don't know how to program in Java then you really shouldn't be making a mod.
  4. Why can't you use the tick one?
  5. public class MyEntity extends SomeEntityClass { private int timer = 0; public void tick() { super.tick(); timer++; } } It's pretty simple.
  6. You need to count ticks in Entity::tick.
  7. That is not the ArrowRenderer. That is inside the EntityRenderer. The EntityRenderer renders the NamePlate of the Entity.
  8. That's what debug mode does. It pauses the execution of code. So the bug is gone?
  9. The best I can do for that is point you here. I don't know how clear that is.
  10. There is likely a little more than this it's been a while since I've messed with Entities. Entities are registered like Items and Blocks. You must also register their renderer with RenderingRegistry.registerEntityRenderingHandler. It depends on the IDE you are using. In eclipse just set a breakpoint and run the game in debug mode. I don't know about IntelliJ Idea or any other IDE. To run in Debug mode click the bug icon next to the Run button.
  11. Create your own entity with it's own EntityRenderer. Yes you understand correctly. And there will not be one. Have you tried using the debugger to see the coordinates of the entity on both the logical server and logical client? It is likely a desync issue.
  12. No this is wrong. You are allowed to override the registry of other mods/Minecraft itself. It would not be intended behavior to crash. It would be intended behavior to crash if you registered a block from your modid twice.
  13. First off where are you rendering at? Also what do you mean "center text"? In the exact middle of the screen? In the middle of the width, middle of the height. or even any other point on the screen?
  14. Which part can you not figure out? How to use GSON to write Json to file? How to get the .minecraft file location? If you want to use .dat I believe you need to store your data in a CompoundNBT then use net.minecraft.nbt.CompressedStreamTools to read and write your file when you need/want to.
  15. Probably because that is not how packets work. Packets are for sending information over a network. IE from a server to client. Draco has already given you what you need to do. Take a look at his example and try to implement your own version for your idea.
  16. Player capabilities is what you would use to store and interact with the data. For rendering you should use the RenderGameOverlayEvent.
  17. Yes there is code that will generate those JSON files for you. Yes you should still be using JSON files. Here are two examples one from Forge, and another from Choonster.
  18. The first float is the entityYaw and the second one is the partial ticks.
  19. I believe you just need to register a Block with the same registry name and it must have all the same block properties IE it's BlockState properties must all be the same.
  20. Override the nether portal block in the block registry with your own that sends you to your dimension. However I'm not sure creating your own dimension is the only way. Not that I have an alternate way to propose.
  21. Click here. Or look up how to use the GSON library in Java.
  22. Agreed definitely not for complicated blocks feel like there should be a simpler version of it for just simple blocks, but that's just me. Thanks. I'll check out that PR. Yes, but might as well strip the code to save the tiniest bit of disk space. Especially if you have used it a lot.
  23. You likely just need to use events to read and write the data. IE when the mod loads(FMLCommonSetupEvent) read the data from the file. And the GSON library is included within the Minecraft/Minecraft Forge project so you can use that to read and write JSON files.
×
×
  • Create New...

Important Information

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