コード例 #1
0
 /// Modifies the item.
 @Override
 public void modifyItem(ItemStatsInfo itemStats) {
   int amplifier = FileHelper.getCount(this.amplifiers, itemStats.random);
   int duration = FileHelper.getCount(this.durations, itemStats.random);
   EffectHelper.addPotionEffect(
       itemStats.theItem, this.potionId, duration, amplifier, this.ambient);
 }
コード例 #2
0
 /// Initializes the entity's stats.
 @Override
 public void init(MobStatsInfo mobStats) {
   int amplifier = FileHelper.getCount(this.amplifiers, mobStats.random);
   int duration = FileHelper.getCount(this.durations, mobStats.random);
   if (this.override) {
     EffectHelper.addPotionEffect(
         mobStats.theEntity, this.potionId, duration, amplifier, this.ambient);
   } else {
     mobStats.theEntity.addPotionEffect(
         new PotionEffect(this.potionId, duration, amplifier, this.ambient));
   }
 }