-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflySPELL.java
More file actions
54 lines (40 loc) · 1.67 KB
/
flySPELL.java
File metadata and controls
54 lines (40 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
package com.example.an_addon.glyphs;
import com.hollingsworth.arsnouveau.api.spell.*;
import com.hollingsworth.arsnouveau.common.spell.augment.AugmentAmplify;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.HitResult;
import javax.annotation.Nonnull;
import java.util.Set;
import static com.example.an_addon.ExampleANAddon.prefix;
public class TestEffect extends AbstractEffect {
public static TestEffect INSTANCE = new TestEffect(prefix("glyph_test"), "Test");
public TestEffect(ResourceLocation tag, String description) {
super(tag, description);
}
@Override
public int getDefaultManaCost() {
return 100;
}
@Override
public void onResolve(HitResult rayTraceResult, Level world, @Nonnull LivingEntity shooter, SpellStats spellStats, SpellContext spellContext, SpellResolver resolver) {
super.onResolve(rayTraceResult, world, shooter, spellStats, spellContext, resolver);
System.out.println("Hello from my resolve!");
applyPotion(mob, player, ENTHRALLED.get(), spellStats);
player.addEffect(new MobEffectInstance(ModPotions.FLIGHT_EFFECT.get(), 60 * 20));
}
@Nonnull
@Override
public Set<AbstractAugment> getCompatibleAugments() {
return augmentSetOf(EXTEND_TIM.INSTANCE);
}
@Override
public int getBaseDuration() {
return POTION_TIME == null ? 30 : POTION_TIME.get();
}
@Override
public int getExtendTimeDuration() {
return EXTEND_TIME == null ? 8 : EXTEND_TIME.get();
}
}