Allright so, ive been looking all over the internet for a solution for this but i cannot find anything. And i know its possible as ive seen it before but i just dont know how. So, a players inventory looks like this: So now i need to find a way to make a player able to place an item in these slot and it will be considered worn or equipped. So for an example we'll take the slots 9 and 10. So if a player has an Diamond_Sword (Or whatever item) it will be equppied as if it was in a armor slot if the player places the item in the slot 9 or 10. But, if the player places it in another slot like 18 it will not count as worn and will not be equpped. So, my question: Does anyone know how i can make this possible? And if so, how? Is there a plugin that does this? Best Regards, FruXo
@FruXo And how about changing inventory slots? Putting it in the offhand: possible, but that can all be changed.
@FruXo No, that is not what I mean. Equipement is based on the offhand slot and the hotbar slot. Why do you want to override that?
As im making an RPG server i want my players to be able to equip jewelry that adds health/damage and so on so i want them to able to equip additonal items in these slots.
So when dealing damage or receiving damage check those slots for your certain items that give bonuses. Unless I'm reading the question wrong?
My problem is that i want to find a way to make this possible, making it able to check every outcomming or incomming attack for these slot that gives bonuses as @oceantheskatr said.
I may not be 100% right (I'm probably not) but I'll try and give you an idea of how it'd work: Use EntityDamageByEntityEvent, when an entity is damaged, check if the damager is a player, if so, check their 9th and 10th slots to see if they have any damage boost items, and if so, set a multiplier variable to a number based on the item, then apply that multiplier to their current damage e.setDamage(event.getDamage() * multiplier). You do practically the same for receiving damage, you check if the damaged entity is a player, and if so check their 9th and 10th slots for health/armour boost items, do the multiplier thing I said above and change the damager's damage accordingly. There could be a better way to do this and I'm sure there is, but hopefully I'm not too wrong and I'm getting you on the right track to implementing this.