Please help ahahaha

Discussion in 'Spigot Plugin Development' started by Crafter145, Apr 24, 2017.

  1. How do i make it if a player places a certain block next to a certain block it wont allow it
    i dont know how to start any help
     
  2. Block place event then, compare block locations.
     
  3. Im trying to find the event its not showing up
     
  4. You shouldn't have to cast Player.

    Code (Text):
    Player player = event.getPlayer();
    HINT: you need to get the block that was placed. Not ItemMeta
     
  5. Ok i changed it so i next did

    if(player.) What do i put after the dont because i cant find the event
     
  6. No, since you are trying to find the block placed on the BlockPlaceEvent make sure to do event. not player.

    EDIT: Perhaps it is event.getBlock();
     
  7. Try player.getInventory().getIteminMainHand()

    EDIT: Just realized what you are trying to do, you will need to do even.getBlock() then get the meta from there
     
  8. This could also work. Depends on how you want to approach it.
     
  9. @EventHandler
    public void onBlockPlaceEvent(BlockPlaceEvent event){
    Player player = event.getPlayer();
    TileTesseract blockMeta = (TileTesseract) player.getItemInHand().getItemMeta();

    if(event.getBlockPlaced() != null) {





    }
     
  10. @EventHandler
    public void onBlockPlaceEvent(BlockPlaceEvent event){
    Player player = event.getPlayer();
    TileTesseract blockMeta = (TileTesseract) player.getItemInHand().getItemMeta();

    if(event.getBlockPlaced() != null) {





    }

    Is this good? so far
     
  11. Im trying to make it so you cant place an aluminum wire next to a tesseract vise versa
     
  12. I know i should be studying the basics which i will after but i need to get this done thank you guys for putting up with me
     
  13. I actually would just get the block, I don't think you need to get the player's hand, do a check if it is a tesseract or aluminum wire, then get the blocks around it and check if it's the opposit placed block, if it is, cancel the event.
     
  14. If you can't figure out what he said just google it. There is no more help we can give you besides coding it for you.