#NMS Entity Disappearing

1 messages · Page 1 of 1 (latest)

plush prairie
raw sandal
#

code?

plush prairie
#

what part

raw sandal
#

anything related to nms

plush prairie
#

ok

#
public class CustomSilverfish extends EntitySilverfish {
    public CustomSilverfish(World world) {
        super(world);
    }

    public CustomSilverfish(Location loc) {
        super(((CraftWorld)loc.getWorld()).getHandle());
        this.setPosition(loc.getX(), loc.getY(), loc.getZ());

        this.persistent = true;
    }
}
```My entity
raw sandal
#

thats it?

plush prairie
plush prairie
#
public void spawnSilverfish(Location l, Team ownerTeam) {
        EntityTypes.spawnEntity(new CustomSilverfish(l), l);
    }
#

That's it

#

Any ideas?

raw sandal
#

did you register it?

#

you need to register it in -1.14

plush prairie
#

I thought that enum was registering it

#

If it doesn't, then how do I register it?

#

(I assume it doesn't)

raw sandal
#

read the section 2

plush prairie
#

I did

#

ok

#

so

#

there are some errors

#

hang on I'll send them

#

well snip & sketch has stopped working

#

oh I cant send screenshots here

#

that's the problem

#

all those errors are because of private access stuff

raw sandal
#

i dont think "d" method returns a map

plush prairie
#

oh

#

well they're all because of private access stuff so lets handle that in a moment

#

how can I fix it

raw sandal
plush prairie
#

EntityTypes

raw sandal
#

ah

#

ookay, did you call addToMaps method?

raw sandal
#

all right, still need to call registerEntities() method in your onEnable

plush prairie
#

ok, but what about the private access errors?

raw sandal
#

what errors

plush prairie
#

gtg to bed, I'll be back in around 14 hours

raw sandal
#

ah use the CustomEntities enum with useless reflection in section 2 if you dont have direct access

plush prairie
#

I don't need reflection but OK

raw sandal
#

well you are saying i dont have access, so how do you think to access those methods

plush prairie
#

no idea

raw sandal
#

with reflection of course lol

plush prairie
#

any ideas?

plush prairie
raw sandal
plush prairie
#

Oh ok

#

I'll just hope someone else knows :)

plush prairie