#(jimjams02) NPC EntityDamageEvent
25 messages · Page 1 of 1 (latest)
(jimjams02) NPC EntityDamageEvent
Hi I'm AutoThreadBot! Don't mind me, I'll just be adding the helper team to this thread so they can see it. A human will get to you soon.
You can block this bot if you don't want to see these messages, I won't mind.
<@&525394568410038282>
And another question
NPC npc = CitizensAPI.getNPCRegistry().createNPC(EntityType.PLAYER, boss.toString());
npc.spawn(location, SpawnReason.CREATE);
npc.setProtected(false);
entity = (LivingEntity) npc.getEntity();
entity.getPersistentDataContainer().set(bossKey, PersistentDataType.STRING, boss.toString());
entity.customName(boss.getDisplayName());
entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).setBaseValue(50);
entity.setHealth(50);
Any idea why setting persistent data container, setting custom name, and setting the max health & setting health dont work
Yes it will always fire that event but it will be cancelled
You should use citizens api to set custom name
Persistent data probably because the entity gets respawned
Max health should work
Maybe it’s also because the entity gets respawned
Maybe do the setup in a traits on spawn method to avoid that issue
Has your issue been resolved, or your question been answered?
If so, please use the </resolved:1028673926114594866> command to close your thread.
Or </invalid:1028673926898909185> if it's not possible to resolve.
If not yet resolved, please reply below to tell us what you still need.
(Note that if there is no reply for a few days, this thread will eventually close itself.)
@mellow crane
What do you mean the entity gets respawned?
You mean when i kill it?
no, you haven't set a skin so it will respawn if the skin loads
@mellow crane
(also if chunk unloads/reloads)
So if i set a skin and dont unload the chunk should it solve the problem?
That worked tysm