Everything posted by Zanckor
-
[1.19] Creating new overlay gui
Eya! I'm trying to do a overlay gui with images (only images, no strings), to do a health bar, like a typical MMORPG overlay gui, but I'm not finding any references on vanilla to do it, so, i would like to know what class to extend, or any vanilla code to check
-
Custom saved playerdata.
Oh wait, my bad lmao, try calling your data inside a CloneEvent to assign them again Like docs say: "reading the data from the original entity and assigning it to the new entity" Thats a CapabilityProvider that maybe can help you: https://github.com/MinecraftForge/MinecraftForge/blob/1.18.x/src/main/java/net/minecraftforge/common/capabilities/CapabilityProvider.java And a 1.17 topic with the same question:
-
Custom saved playerdata.
*Don't read that, is not about capabilities Ya, you need to use Clone event, so, where you are registrying your data, you need to add an PlayerEventClone and add your data. For example, I've a class called "assignStat.java", here I've a method called "assignStatsOnLoggin" and "assignStatsOnClone", both method have the same code, but "assignStatsOnClone" is PlayerEvent.Clone That's because when you die or teleport all your data is deleted and recreated in a new entity, so, you need to put your data again
-
Custom saved playerdata.
Eya! That's my capabilities system: https://github.com/Zanckor/Dragon-Ball-Z/tree/main/src/main/java/com/zanckor/capabilities I think, you can keep Capabilities.class like already is. On IMyCapability, you need to put your values, like: int getNumber(); void setNumer(int NUM); #to set your value to X void addNumber(int value); #to add X to your value On MyCapabilityAttacher.class just put your MODID On MyCapabilityImplementation.class delete my values and put yours I hope that can help you
-
[1.19] Creating new Packet
So, why should i send packets if it works now?
-
[1.19] Creating new Packet
Look, with this code is already working without packets, at least on singleplayer, that should work on multiplayer too? Is regenerating and working with other methods https://ibb.co/B3NXYGx
-
[1.19] Creating new Packet
Okay, so, i should do something like, if(player instanceof ServerPlayer){ RegenCode } and, if(player instanceof Player) { RegenCode }, but when, on server side, Current Ki is full, 0, or whatever i want, send a packet to check if both values are the same, and if not change client value Edit: Okay, i realized that its better just make it server side, and whenever i need to use it, like, before attacking with ki, send a packet to sync it
-
[1.19] Creating new Packet
Wait a second xD, so, i need to put my regen code on server side, and then sync it from server to client, arent? But, I still dont know how to put this code on server side, i mean, if i put it on ServerTickEvent i cant put (Player player = e.getPlayer), so, how server know to which player is this info
-
[1.19] Creating new Packet
So, i need to call this custom packet on ServerTickEvent, but this dont will lag player?
-
[1.19] Creating new Packet
ya, all its working, but is not sending it to server side
-
[1.19] Creating new Packet
Okay, its done, but, when I want to regen my Ki, it still not working cause it is on PlayerTickEvent. I've upload my new code to github Btw, my code is a bit ugly cause I'm just testing
-
[1.19] Creating new Packet
So, how can I make the actual system work in server side?
-
[1.19] Creating new Packet
Oh ya, sorry, now is public
-
[1.19] Creating new Packet
Here again... Well, actually imo I need to create a new packet. I'm creating a KI system (should work like a mana system, just another name), so, I've created an EventHandler to regen my Ki, but it works on client side, is there any other way to regenerate Ki with server side? Or, what I think I should do, create a packet to send my Ki from Client to Server. https://github.com/Zanckor/Dragon-Ball-Z/blob/main/src/main/java/com/zanckor/events/valueStatBars.java
-
[1.19] Creating new Packet
Tnks! It apparently works, but idk why on "Run" appears me some errors (10)
-
[1.19] Creating new Packet
K, its done, i just restarted it, and now it works
-
[1.19] Creating new Packet
ya, i made it https://ibb.co/0Bjh0CL
-
[1.19] Creating new Packet
K, i know what's not working, idk why but is not reading the .cfg
-
[1.19] Creating new Packet
I dont really understand it ๐
-
[1.19] Creating new Packet
Eya! I was testing some stuff with my new capabilities, and i recently seen that max health i can put is 1024, there's any way to increase max max health?
-
[1.19] Creating new Capabilities
Oh fuck ma bad, i did something else
-
[1.19] Creating new Capabilities
Ya, i think
-
[1.19] Creating new Capabilities
Capabilities.getPlayer(e.getPlayer()) is returning me always "null", so whenever i try to set any value minecraft crashes. Why is returning me "null"?
-
[1.19] Creating new Capabilities
Where and how I should register it? Failing is that something is wrong/not working
-
[1.19] Creating new Capabilities
Eya! I'm here again ๐ I'm trying to create a custom capabilities, I've made caps before on 1.16, but idk how to make them on 1.19 and something is failing. Here's my code: https://github.com/Zanckor/DBZ.git
IPS spam blocked by CleanTalk.