Is there a way to prevent players from switching items (In hand)?

Discussion in 'Plugin Development' started by Birdytrap, Jan 30, 2013.

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


    Is there a way to prevent players from switching items? I wrote a code, but if the player switches his item when the event isnt finished, everything is ruined.. So is there a way to prevent player from switching items?
  2. Offline


    Please give us more details about the problem and what you are trying to do.
  3. Offline


    Well, I just want to change the lore and item durability of the item in the hand. But if a player switches the item in his inventory, the wrong item will get the lore and durability change...
  4. Offline


    show your code
  5. Offline


    I don't think you need the code however. I am only asking if there is a way to prevent players from switching items...
  6. Offline


    well i am interrested in the same way, i'd like to have a possibility to prevent the user from switchig the item in hand for a while, to simulate the time needed to holster the first item in hand and then picking the new item.

    my idea was "onitemheld" to remove the item in hand for 2 sec, fix his velocity at 0 then switch the item in hand to the new slot that >I< can decide and release his freeze after 2 sec with the new item in hand! or maybe an addition to the playeritemheld event, make it cancleable.

    so i can cancel out the item switch, remove the item in that slot, freeze the player and then put another item back and unfreeze

    i'd like to have an more limited UI for some kind of RP feature and making combat more difficult ... maybe it's helpful against macro users too :) never again any fastswitch/autodamagepotionthrowing/permasswordswinging cheaters in pvp ... and please don't scold me if it's impossible from clientside i did not work with the client code at the moment
  7. Offline


    unfortunatly nobody seems to like this idea, so i'll have to find a workaround
Thread Status:
Not open for further replies.

Share This Page