18 lines
646 B
Java
18 lines
646 B
Java
package net.mcreator.target.procedures;
|
|
|
|
import net.mcreator.target.init.TargetModItems;
|
|
import net.minecraft.world.entity.Entity;
|
|
import net.minecraft.world.entity.player.Player;
|
|
import net.minecraft.world.item.ItemStack;
|
|
|
|
public class MinigunfireProcedure {
|
|
public static void execute(Entity entity) {
|
|
if (entity == null) return;
|
|
if (entity instanceof Player player && !player.isSpectator()) {
|
|
ItemStack usehand = player.getMainHandItem();
|
|
if (usehand.getItem() == TargetModItems.MINIGUN.get()) {
|
|
entity.getPersistentData().putDouble("minifiring", 1);
|
|
}
|
|
}
|
|
}
|
|
}
|