Everything posted by Animefan8888
-
Saving and editing local stored data
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.
-
1.15.2 Center text
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?
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?
Why can't you use the tick one?
-
[ 1.15.1 ] How do you create a timer?
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?
You need to count ticks in Entity::tick.
-
[1.15.2] ArrowRenderer incorrectly draws an arrow at a modified velocity
That is not the ArrowRenderer. That is inside the EntityRenderer. The EntityRenderer renders the NamePlate of the Entity.
-
[1.15.2] ArrowRenderer incorrectly draws an arrow at a modified velocity
It isn't.
-
[1.15.2] ArrowRenderer incorrectly draws an arrow at a modified velocity
That's what debug mode does. It pauses the execution of code. So the bug is gone?
-
[1.15.2] ArrowRenderer incorrectly draws an arrow at a modified velocity
The best I can do for that is point you here. I don't know how clear that is.
-
[1.15.2] ArrowRenderer incorrectly draws an arrow at a modified velocity
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] ArrowRenderer incorrectly draws an arrow at a modified velocity
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.
-
[1.15.2] Replace water in nether with lava
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.
-
1.15.2 Center text
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?
-
Saving and editing local stored data
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.
-
Stopping and Checking Sound
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
Show what you have tried.
-
Im trying to figure out how to add a thirst bar to my mod
Player capabilities is what you would use to store and interact with the data. For rendering you should use the RenderGameOverlayEvent.
-
[1.15.2] Set Item model from code
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.
-
Player rendering
The first float is the entityYaw and the second one is the partial ticks.
-
[1.15.2] Replace water in nether with lava
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
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.
-
Saving and editing local stored data
Click here. Or look up how to use the GSON library in Java.
-
Using BlockStateProvider
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.
-
Saving and editing local stored data
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.
IPS spam blocked by CleanTalk.