Melonslise
Members-
Posts
183 -
Joined
-
Last visited
Everything posted by Melonslise
-
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Why would it if I made it static? How do I fix that? -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Right, so how do I do that? Through packets? Then why don't the vanilla mobs use packets? -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
So does this mean I'll need to spawn the entity on both sides? -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
I used the debugger to check the entries in the entity's DataManager and it looks like my integer id value is not on the list. I saw six entries each corresponding to each DataParameter declared in in the Entity base class. I don't understand why mine isn't there though. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
I'm getting a ticking entity: nullpointer error and the compiler is pointing at my getCaster() method at line 220 where I get the key from DataManager. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Well the DataManager#register method takes a value param, so I thought that's what would be stored. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
I thought that when I register it I set the value to the key as well. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
I did everything except I didn't create an owner field. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
I did what you told me to (I was going to anyway) and I'm now getting an error when retrieving the int entity id from the DataManager. So basically the same problem again. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Ow sorry I forgot to add the pastebin link. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
The compiler is pointing at the getCasterUUID() method. I am going to add the ID to the DataManager once I get this fixed. I don't understand why you're recommending to use regular ID, though, since it's quite unreliable afaik. Can't the client get an entity's UUID? -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
I'm getting a nullpointer error when trying to retrieve an optional uuid from the DataManager. Do you have any ideas? -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
So to pass the entity's id I'll need yet another DataManager or is there an easier way? Here's the method code: -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Is there any way to get the list of all players on the server? Since servers can have different worlds afaik. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Ok, how do I get entity by UUID? -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
The DataParameter cannot store Entities so I'll have to store player by either name or UUID. I'm going to use UUID, but I'd like to know how to obtain a player's UUID and if I can compare an EntityLiving's UUID with a player's. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
So I'm going to need to create a new DataParameter, register it and then get/set the player using the entity DataManager? Does that mean I don't need to create variables in the entity class and instead just use DataManager.get/set? Also why don't the vanilla classes like EntityFireball/EntityThrowable use DataManager? -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Alright, how do I pass the value to the client then? -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
EDIT: Actually no, it looks like my client side entity isn't receiving the player who cast the spell. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
So you think that vanilla code is broken? Anyway, I think I understand what the problem is. It looks like I'm killing off the entity only on the server side so the client entity keeps moving. But in the vanilla code entities are always killed on the server side. Is vanilla broken or am I missing something? I thought the server would update the client automatically. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Well the thing is that I do not spawn the entity on the client, so it doesn't need to know those values. Also I have no idea why there are 2 client entities. I use usernames because I just copied the code from EntityThrowable. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Take a look at the EntityFirebolt class and it's onImpact() method. The sysout gets printed 3 times when I right click with my item, 2 times on the client and once on the server. Its seems that the first print on the client gives me a correct ray trace entity, however the second print on the client tells me that it collided with the player, which I specified no to happen in the base EntityProjectile class. -
[SOLVED] [1.10] Client spawns two entities
Melonslise replied to Melonslise's topic in Modder Support
Sorry I created the thread by accident before I could finish writing. The code is in the first post. -
I made sure my item spawns my entity only on the server side, however when testing I see the impact method ran 3 times, 2 times for the client and 1 time on the server. Note that the one of the client methods returns the correct value, while the other collides with the player, which I specified not to. I'm pretty sure the collision happens because the caster variable is null, however I don't know why. Here's the base class: https://pastebin.com/9ezYndWt The entity I'm spawning: https://pastebin.com/7PsYLHxx And the item that spawns the entity: https://pastebin.com/muPFHwMu
-
Alright, looks like the problem was caused because I was using my own variables for speed instead of the predefined motion variables. Can anyone explain to me why this happens? I looked around the Entity code and found nothing that could cause this. Also could anyone tell me what's the best frequency to set when registering my entity. What is it measured in? (e.g. updates/tick)