Hello i try to get the
org.spongepowered.api.entity.Entity; Object from or With the net.minecraft.entity.Entity;
But the UUID are Different and i can’t find the Spawned entity with it
Please help me
MFG Christian
Just try to cast the object
That dosn’t work you can’t cast from Minecraft to Sponge Interfaces
uh, yes you can. that’s how it works. Minecraft implements the Sponge API at runtime.
This is the most surprising part to me.
CVDH If you have a hard code example we may be able to help more.
SpongeForge & SpongeVanilla use GitHub - SpongePowered/Mixin: Mixin is a trait/mixin and bytecode weaving framework for Java using ASM in order for the minecraft entities to implement our interfaces at runtime.
Whilst this might not be guarantee’d in some cases, as far as I know it’s correct for all (vanilla) entities.
Modded entities probably also implement the classes at runtime, but there may be ways of escaping some of the mixins that I’m not aware of, My knowledge is a little more shaky here.
Okay I now tryed out to cast it And it worked ;D
Thats new 4 me thanks alot
But iths strange that the UUID is not listet on [World.getEntities] (for each) .getUUID
If you extend a class implementing an interface, you too implement the interface, without anything extra being present in your bytecode. Sponge mixes into Entity, and all NMS methods only accept Entities. A mod would have to invent a completely new type of entity.