Pseudo

Discussion in 'Plugin Development' started by Iervolino, Jun 19, 2013.

Thread Status:
Not open for further replies.
  1. Offline

    Iervolino

    Code:
    //FIREMAGE
    if((event.getAction() == Action.RIGHT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_BLOCK)){
    ItemStack item = event.getPlayer().getItemInHand();
    if (item.getTypeId() == FiremageItemId) {
    long lastUsed = 0;
    if (Firemage.containsKey(player.getName()))
      lastUsed = Firemage.get(player.getName());
    if (lastUsed + (1000 * cooldown3) > System.currentTimeMillis()) {
      event.getPlayer().sendMessage(
              String.format(FiremageCooldownMessage,
                      (-((System.currentTimeMillis() - (lastUsed + (1000 * cooldown3))) / 1000))));
    } else {    
    Hey, I made this pseudo with a cooldown, and I don't know a pseudo for when right click shot a firecharge ball or a (fireball)..

    Can someone make this pseudo thanks!
     
  2. Offline

    sebasju1234

    What are you trying to do? Shooting a fireball?
     
  3. Offline

    Iervolino


    Shot a fireball from a blaze_rod when you right click..

    I only need the projectile pseudo, I'm noob and I don't know how to do it
     
  4. Offline

    sebasju1234

    Just spawn a new item entity into the world @ the players location and set the velocity.
     
  5. Offline

    Iervolino


    Yes, and idk how to do it, i don't even have the idea.. Because this I created this thread, for someone make the pseudo..

    Can you please make it? thanks if yes!
     
  6. Offline

    sebasju1234

    Code:
        public void onPlayerInteract(PlayerInteractEvent event) {
            Player p = event.getPlayer();
           
            if(event.getAction() == Action.RIGHT_CLICK_AIR && p.getItemInHand().getType() == Material.BLAZE_ROD){
               
                final Item toShoot = p.getWorld().dropItem(p.getEyeLocation(), new ItemStack(Material.FIREWORK_CHARGE));
               
                toShoot.setVelocity(p.getLocation().getDirection().normalize().multiply(2));
            }
        }
    Something like this will work, got it from the source of one of my plugins.
     
  7. Offline

    Iervolino


    Worked, but the player shot a FireCharge ITEM and not the Fireball...
     
  8. Offline

    sebasju1234

    Just modify the code, you wanted a pseudo, well, this is how you can do it, but you have to edit it. :p
     
  9. Offline

    Tirelessly

    world.spawn and Fireball.class. jd.bukkit.org/doxygen/
     
  10. Offline

    Iervolino


    Please, as I said I'm noob, make the pseudo please!
     
  11. Offline

    Tirelessly

    Did you attempt to go on the website I posted? You can look up how to do it yourself. There's a search bar. Search for the spawn method. Find out what parameters it takes.
     
  12. Offline

    zack6849

    I have a feeling you don't quite understand what pseudo means.
     
    jdawgerj515, Tirelessly and JazzaG like this.
  13. Offline

    Iervolino


    Hey, so I made the code, but do you know some way to increase the fireball explosion damage in the player?

    Code:
    Location loc = player.getEyeLocation().toVector().add(player.getLocation().getDirection().multiply(2)).toLocation(player.getWorld(), player.getLocation().getYaw(), player.getLocation().getPitch());
    @SuppressWarnings("unused")
    Fireball fireball = player.getWorld().spawn(loc, Fireball.class);
    player.playSound(player.getLocation(), Sound.NOTE_PIANO, 10, 0);
     
  14. Offline

    jdawgerj515

    @zack6849 and @Iervolino

    pseu·do

    [soo-doh]

    adjective
    1.
    not actually but having the appearance of; pretended; false or spurious; sham.

    2.
    almost, approaching, or trying to be.


    Do some research in the bukkit apidocs (google it) That is where you can see every single method Bukkit has. If you make the attempt to do some research prior to asking, your chances of people responding will quadruple, even if you still don't understand it.


    Because right now all you are doing is going around and asking for the code and you are barely doing any of it yourself. And I am not saying asking to see code is bad because that can help you understand.

    You are going to need to use the ExplosionPrimeEvent for what you need. Here is the page for it: http://jd.bukkit.org/rb/doxygen/d0/..._1event_1_1entity_1_1ExplosionPrimeEvent.html

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Jun 2, 2016
    Tirelessly likes this.
Thread Status:
Not open for further replies.

Share This Page