Project MMO

Project MMO

11M Downloads

Death by Creeper Explosion causes crash

SneakySlaps opened this issue ยท 3 comments

commented

When being caught in a creeper explosion that kills you, it will crash the game.

Steps to reproduce the behavior:

  1. Play in survival mode
  2. /summon minecraft:creeper on top of yourself
  3. Let it kill you.

Versions:

  • Minecraft: 1.21.1
  • Loader: neoforge 21.1.97
  • PMMO: 1.21.1-2.6.20

I have moonlight Lib and MmmMmmMmmMmm (Target Dummy) installed.

crash-2025-01-30_22.36.32-server.txt

commented

Talked in Discord. Can not reproduce. Seems to be a config issue. Waiting for more data.

commented

Seems to be a script:

WITH config(perks)
    set(clear_all);
    set().event(DEAL_DAMAGE)
        .perk("pmmo:damage_boost")
        .skill(archery)
        .multiplicative(false)
        .base(1)
        .per_level(0.25)
        .applies_to(["minecraft:bow"]);
END
commented

Ah, I see:

public static void saveAttributesOnDeath(LivingDeathEvent event) {
if (event.getEntity() instanceof Player player) {
for (CompoundTag nbt : Config.perks().perks().get(EventType.SKILL_UP).stream()
.filter(tag -> tag.getString("perk").equals("pmmo:attribute")).toList()) {
Holder<Attribute> attribute = getAttribute(nbt);
AttributeInstance instance = player.getAttributes().getInstance(attribute);
if (instance != null)
instance.getModifiers().stream()
.filter(mod -> mod.id().equals(attributeID(nbt.getString(APIUtils.ATTRIBUTE), nbt.getString(APIUtils.SKILLNAME))))
.forEach(mod -> respawnAttributes.put(player, new AttributeRecord(attribute, mod)));
}
}
}

This fails when there are no SKILL_UP perks.