-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMultipleAttackHadler.java
More file actions
46 lines (36 loc) · 1.12 KB
/
MultipleAttackHadler.java
File metadata and controls
46 lines (36 loc) · 1.12 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
package com.darahz.dmod.events;
import com.darahz.dmod.dMod;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.util.Hand;
import net.minecraftforge.event.TickEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus;
@Mod.EventBusSubscriber(modid = dMod.MOD_ID, bus = Bus.FORGE)
public class MultipleAttackHadler {
private static int ticks = 20 * 1;
private static boolean running = false;
private static Hand hand = null;
private static PlayerEntity player = null;
private static int repeats = 0;
public static void queueAttack(int delayTicks, PlayerEntity playerIn,
Hand handUsing) {
player = playerIn;
hand = handUsing;
repeats = 3;
running = true;
}
@SubscribeEvent
public static void doAttacks(TickEvent.ClientTickEvent event) {
if (!running)
return;
if (ticks % 20 == 0)
if (repeats != 0) {
// Do what ever else you want
player.func_226292_a_(hand, true);
repeats--;
} else
running = false;
ticks++;
}
}