-
Posts
20 -
Joined
-
Last visited
Posts posted by Nitoxym
-
-
1 minute ago, Kiljaeden053 said:
What if you detect it to the server then make a custom info then send it to the client?
It's a client only mod
-
Just now, diesieben07 said:
EntityDataManager cannot help you here.
Then what do I use?
-
Just now, diesieben07 said:
Did you even look at the code you linked to?
My bad, I checked after
Just now, diesieben07 said:Well, what do you want to achieve?
I want to detect when the entity is dying, then I'll manage to detect "if the entity is killed by the player"
-
1 minute ago, diesieben07 said:
They check that the entity dying either was the entity you last attacked or the entity you are looking at.
How can I do that?
5 minutes ago, Nitoxym said:EntityDataManager
Also, where do I use that? And how?
-
3 minutes ago, diesieben07 said:
Not easily, there's no event being fired. The way it works is that the health of the entity is synced to the client using EntityDataManager and the client starts doing the death animation if the health is <= 0.
Ok thanks, but how can I be sure that the player killed the entity? I saw this mod, and they managed to do it, but I can't figure how: https://github.com/symt/zealot-counter/tree/1.2.2/src/main/java/io/github/symt
What I know is that it only detects when the player one shot the mob
-
Any way to detect that animation? Or the fact that the entity is removed?
Also, any way to know if this is player who killed it?
-
Hey!
I wanted to know if it is possible to detect client side when an entity dies. It works with LivingDeathEvent server side, but not client side. Thanks!
- 1
-
1 minute ago, Animefan8888 said:
There is one for getScaledWidth/Height
That's exactly what I needed, thanks! ?
-
2 minutes ago, Animefan8888 said:
Take a look at those two classes. CompoundNBT and CompressedStreamTools.
Ok, i'll check docs for that
2 minutes ago, Animefan8888 said:You can get the game directory by doing Minecraft.getInstance().gameDir but do note that this will not work on dedicated server.
It is a client only mod (and personal tool) so no problems with that
2 minutes ago, Animefan8888 said:Here is an example where I have used GSON to write JSON files. Though it might be too complicated for an example.
Ok, thanks, i'm checking that!
-
What do you mean? An event, class? If so, it's in RenderGameOverlayEvent
-
9 hours ago, Animefan8888 said:
Which part can you not figure out?
How to use GSON to write Json to file?
How to get the .minecraft file location?.minecraft, I might have an idea, but not sure, to use GSON, I have no idea, and I don't understand most of the posts
9 hours ago, Animefan8888 said: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.
May I have any example please? Or any method to do this
-
9 hours ago, Animefan8888 said:
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?
At the middle of the width and height, and I'm rendering in game
And screenWidth is the width of the real screen, or the scaled one?
-
Well, I can't figure how to do it, I feel stupid '-'
But I noticed that some mods use dat files in .minecraft dir, how can I do this with dat or JSON at this location? And how can I edit it with code?
-
Hello!
I wanted to know how can I center text in 1.15.2, I searched ScaledResolution, but it doesn't seem to exist.
Thanks!
-
-
5 minutes ago, Animefan8888 said:
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.
Ok perfect, and how can I do that?
-
2 minutes ago, Animefan8888 said:
You want to through all worlds keep track of certain things?
I need to store values, and keep them wherever I go, like a vanilla setting doesn't change on different world
3 minutes ago, Animefan8888 said:If so you will need to write to a file yourself. Forge doesn't have anything for universal persistence that I know of. Though you can use basic IO or JSON(GSON) for stuff that is loaded and saved once.
Does Forge support that? YML, JSON, .properties, is there a "vanilla" way to do that, or I have to create one myself?
-
3 minutes ago, Animefan8888 said:
Sounds like you want to use a capability. Probably a capability attached to the World.
Does it work even if I change world / server in multiplayer? If so, how can I use it?
-
Hey!
So I want to create a system that displays the number of a certain mob with a certain name, for example, a Creeper named "Creep". I know how to create the event, how to display the text, but what I need is a system that permit me to store the number value, and get it back even after game restart, any idea how to do this?
I'm developing in 1.15.2
LivingDeathEvent client side 1.15.2
in Modder Support
Posted
The mod is supposed to be a counter for a server, and only count mobs with specific names
But finally, I'll warn people to use it only if they can one shot the mob, so I only count attacks