I want to create custom arrows, part of which I have already done in IntelliJ, and it works, but the arrows are issued through Skript. How can I set a custom name for the arrow so that I can check it in IntelliJ?
CSS:
command /test:
trigger:
if arg-1 is set:
set {_item} to arrow
give {_item} to arg-1
Java:
@EventHandler
public void onProjectileHitEvent(ProjectileHitEvent e) {
Projectile proj = e.getEntity();
if (proj instanceof Arrow) {
Arrow arrow = (Arrow) proj;
if (arrow.getCustomName().toLowerCase().equals("freeze")) {
LivingEntity shooter = (LivingEntity) arrow.getShooter();
shooter.teleport(arrow.getLocation());
arrow.remove();
}
}
}