-
Posts
6157 -
Joined
-
Last visited
-
Days Won
59
Everything posted by Animefan8888
-
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.
-
Not that kind of where, where is your code going to be located for this rendering operation?
-
[ 1.15.1 ] How do you create a timer?
Animefan8888 replied to Dr.Nickenstein's topic in Modder Support
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. -
[ 1.15.1 ] How do you create a timer?
Animefan8888 replied to Dr.Nickenstein's topic in Modder Support
Why can't you use the tick one? -
[ 1.15.1 ] How do you create a timer?
Animefan8888 replied to Dr.Nickenstein's topic in Modder Support
public class MyEntity extends SomeEntityClass { private int timer = 0; public void tick() { super.tick(); timer++; } } It's pretty simple. -
[ 1.15.1 ] How do you create a timer?
Animefan8888 replied to Dr.Nickenstein's topic in Modder Support
You need to count ticks in Entity::tick. -
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.
-
[1.15.2] Replace water in nether with lava
Animefan8888 replied to RobinCirex's topic in Modder Support
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. -
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?
-
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.
-
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.
-
[1.15.2] How would I go about changing the player's model
Animefan8888 replied to Twingemios's topic in Modder Support
Show what you have tried. -
Im trying to figure out how to add a thirst bar to my mod
Animefan8888 replied to Cosmic_Israel's topic in Modder Support
Player capabilities is what you would use to store and interact with the data. For rendering you should use the RenderGameOverlayEvent. -
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.
-
The first float is the entityYaw and the second one is the partial ticks.
-
[1.15.2] Replace water in nether with lava
Animefan8888 replied to RobinCirex's topic in Modder Support
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. -
[1.15.2] Replace water in nether with lava
Animefan8888 replied to RobinCirex's topic in Modder Support
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. -
Click here. Or look up how to use the GSON library in Java.
-
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.
-
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.