Shield slot 1.14

Discussion in 'Plugin Development' started by TerroDoor, Nov 25, 2019.

  1. Offline

    TerroDoor

    I’m curious, can I disable players taking items set in the shield slot? Which slot is it?

    Also, I need to update my BuiltTools via git bash terminal, what do I put there to get the latest build? Thankyou for your time guys


    Sent from my iPhone using Tapatalk
     
  2. Online

    timtower Moderator Moderator

    @TerroDoor Updating BuildTools: just download it again, it is always the same command.
    And the offhand slot.
     
  3. Offline

    TerroDoor

    Thankyou!


    Sent from my iPhone using Tapatalk

    Alright so I’ve got an item placed in the off-hand slot but I don’t want to allow the player to drop or move the item, how do I go about it?


    Sent from my iPhone using Tapatalk

    EDIT by Moderator: merged posts, please use the edit button instead of double posting.
     
    Last edited by a moderator: Nov 25, 2019
  4. Offline

    yPedx

    @TerroDoor
    Listen to PlayerDropItemEvent and InventoryClickEvent and compare the clicked/dropped item with a shield, then cancel if conditions are true.
     
  5. Offline

    TerroDoor

    Thanks for the response, I understand what your saying but when you say “compare with a shield” are you talking about the slot or item stack?


    Sent from my iPhone using Tapatalk
     
  6. Offline

    yPedx

    @TerroDoor
    If you want your code to always trigger when it's a shield, you could just compare the material. Make sure to check if the itemstack is null before doing so!
     

Share This Page