How would I make so when I right click with a bone, it will shoot a line of hearts in the direction the player is facing? (like the hypixel TNT Wizards VIP+ Blood wand)? I know how to do the interact with Bone thing, I just need to know how to do the hearts Thank you!
DarkBladee12 Thank you, How would I make it so it shoots out of the bone? I have this so far: Code: @EventHandler public void onInteract(PlayerInteractEvent event){ Player player = event.getPlayer(); if(player.getItemInHand().getType() == Material.BONE){ if(event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK){ double health = player.getHealth(); int hunger = player.getFoodLevel(); if(health <= 5){ player.sendMessage("§cNot enough health!"); return; } if(hunger <= 5){ return; } if(health > 5){ player.setHealth(health - 5); player.setFoodLevel(hunger - 5); player.getLocation().getWorld().createExplosion((Location) player.getTargetBlock(null, 50), this.getConfig().getInt("ExplosionSize")); ParticleEffect.HEART.display(WHAT GOES HERE?, 0, 0, 0, 5, 50); } } } }
Sweatyyyy In the class library , it asks for a location for the first argument. Perhaps you can try the following. Thank me later if it helped. Code:java ParticleEffect.HEART.display(player.getLocation(), 0, 0, 0, 5, 50);
Sweatyyyy Why are you casting player.getTargetBlock(null, 50) to a location? You should rather use player.getTargetBlock(null, 50).getLocation(). For the beam you would have to add this: Code:java for (Block b : player.getLineOfSight(null, 50)) ParticleEffect.HEART.display(b.getLocation(), 0.1F, 0.1F, 0.1F, 0, 10);