zhuowei / MCPELauncher

Source code for BlockLauncher, a launcher that patches Minecraft for Android
Apache License 2.0
671 stars 193 forks source link

Suggestion: Make removeEffect return true/false #1440

Open FanisDeligiannis opened 7 years ago

FanisDeligiannis commented 7 years ago

I believe that "removeEffect" should return true or false depending on whether it did something or not, especially since there isnt something like "checkEffect".

Example:

if(Entity.removeEffect(Player.getEntity(),MobEffect.movementSlowdown)) { ModPE.showTipMessage("Effect removed!"); }

CtrlAltCuteness commented 7 years ago

I would prefer if there is a resultArray Entity.getAllEffects( targetEntity ) instead. If the entity type doesn't support effects (I don't know if items can or not), return null ?

Maybe the result array is in the following layout per array entry? I forgot at this time all the params but some will be useful for some devs?

[ effectId , effectLevel, ticksRemaining ]