User Tools

Site Tools


tutorial:status_effects

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Last revisionBoth sides next revision
tutorial:status_effects [2021/09/01 18:47] – Added a new way to create a custom effect bananatutorial:status_effects [2022/02/17 08:59] – [Creating Status Effect Class] sattes
Line 14: Line 14:
   public ExpStatusEffect() {   public ExpStatusEffect() {
     super(     super(
-      StatusEffectType.BENEFICIAL, // whether beneficial or harmful for entities+      StatusEffectCategory.BENEFICIAL, // whether beneficial or harmful for entities
       0x98D982); // color in RGB       0x98D982); // color in RGB
   }   }
Line 33: Line 33:
   }   }
 } }
-</code> 
- 
-==== Creating Status Effect Inline ==== 
-If you want to mostly use the StatusEffect class, you may not need an extra class. Using this syntax with ''{}'' behind the constructor you can override methods. 
-<code java> 
-InstantStatusEffect BURNING = new InstantStatusEffect(StatusEffectCategory.NEUTRAL, 0) { 
-    @Override 
-    public void applyInstantEffect(@Nullable Entity source, @Nullable Entity attacker, LivingEntity target, int amplifier, double proximity) { 
-        if (!target.isSpectator()) { 
-            target.setOnFireFromLava(); 
-        } 
-    }; 
 </code> </code>
  
tutorial/status_effects.txt · Last modified: 2023/01/12 07:06 by tao0lu