#What is required to create a custom Entity child class?

27 messages · Page 1 of 1 (latest)

unique elk
#

I'm working on an entity that is closer to something like TNT (too different to just inherit from the PrimedTNT class unfortunately) than anything that stems from LivingEntity. It doesn't have health, an inventory, etc. etc. What is actually required to be implemented to create a valid Entity in game? My current code is clearly lacking something, since despite the game actually launching, attempting to summon the entity shows Unable to summon entity in chat.

ionic cloud
unique elk
#

Yes and yes

ionic cloud
#

Huh. Try summoning one using code, instead of commands.

#

Commands tend to swallow errors, whereas creating one using code should show the full message.

unique elk
#

There's no errors?

#

unless I messed up the entity spawning code somehow

#

This is correct, yes?

#

Could the issue perhaps be with the renderer? I pretty much copied it line for line from the example docs though

cunning token
#

Non-livings don’t have attributes by default

#

You might want to call the constructor directly

unique elk
cunning token
#

The constructor for your custom entity l

#

*instead of doing it through the spawn method

unique elk
#

Trying to spawn it by calling addFreshEntity on a new instance of the entity class causes a warning: Skipping Entity with id: entity.neutron.black_hole

cunning token
#

What is the rest of the log

unique elk
#

That might take a second to send, I'm on a mobile connection right now (might even run out of hotspot)

cunning token
#

!!paste

tame sealBOT
#
Using a Paste Site

When sharing a large piece of code or a log, you should use a paste site instead of uploading a file or dumping it in a large codeblock.
Dumping your code/log in a code block or a message can make it difficult for other people to read previous messages.

Paste sites and their size limits:

» GitHub Gist: 100 MiB / Requires an account
» Paste.gg: 15 MiB / Account is optional
» Mclo.gs: 10 MiB / Anonymous (designed specifically for Minecraft logs)
» Paste.ee: 1 MiB / Account is optional (raises limit to 6 MiB)
» Pastebin.com: 512 KiB / Account is optional
» Hastebin.com: 400 KiB / Anonymous

cunning token
#

The logs didn’t say why

#

¯_(ツ)_/¯

unique elk
#

Yeah, I noticed

cunning token
#

Call new BlackHoleEntity(yourEntityType, world)

unique elk
#

the actual BlackHole class is just an empty extension of the Entity class right now, only implementing the required methods

#

and even those are empty