Pocketmine-mp: Effects can be given to non-Living classes

Created on 3 May 2017  路  6Comments  路  Source: pmmp/PocketMine-MP

Issue description




Effects can be given to non-Living.php classes like: Items, Arrows, FallingSand and cause the Level to freeze
Only Living classes are actually _tickable_ by effects in vanilla (Mobs + Human)

Steps to reproduce the issue

  1. Apply an effect to a mentioned type above
  2. Could not tick level, getAmplifier/Effect/id on null (varies)

OS and versions

Crashdump, backtrace or other files

  • Later, really busy at work right now
API Core Fixed

Most helpful comment

Or maybe just move the function from Entity to Living and everything will be alright.

I think this is a valid fix, why check if the entity is living, just put it in the Living class and no extra checks need to be done.

All 6 comments

tl;dr: entities are a confusing inconsistent mess. Same thing applies with attributes.

Shouldn't special arrows be able to have effects? or is it just the particles that follow them?

@jasonwynn10 no, tipped arrows have metadata for potion particles.

I don't know if this would be a valid fix but eh..

class Projectile extends Entity {
    public function addEffect(Effect $effect){
        throw new \Error("really...");
    }
}

Or maybe just move the function from Entity to Living and everything will be alright.

Or maybe just move the function from Entity to Living and everything will be alright.

I think this is a valid fix, why check if the entity is living, just put it in the Living class and no extra checks need to be done.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MisteFr picture MisteFr  路  3Comments

HipsterAF picture HipsterAF  路  3Comments

dktapps picture dktapps  路  3Comments

Ox531 picture Ox531  路  3Comments

Hugheth picture Hugheth  路  3Comments