Action

Discussion in 'Plugin Development' started by RingOfStorms, Sep 15, 2012.

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

    RingOfStorms

    So I cam working with a wand and I use action.left_click_air, and left_click_block with a stick in hand to cast a spell.

    The problem is if you are to close to the thing you're casting at, like a sheep, and just hit it with the stick, it does not cast the spell. There is no action for player hit or anything but it is the player interact, so how do I tell if the player hit something as oppose to just clicking in the air/block?

    So I need click on block/air/entity basically, not just block/air.
     
  2. Offline

    makskay

    Listen for EntityDamageByEntity events, check the item in hand of the damager entity if it's a Player?
     
  3. Offline

    travja

    Listen for EntityDamgeEvent then getDamager see if it's a player, then get the item in the players hand and continue your code.
     
  4. Offline

    RingOfStorms

    getDamager seems to not exists any more?

    Edit: nvm need to use entitydamagebyentity
     
Thread Status:
Not open for further replies.

Share This Page