SkriptLang / Skript

Skript is a Spigot plugin which allows server admins to customize their server easily, but without the hassle of programming a plugin or asking/paying someone to program a plugin for them.
https://docs.skriptlang.org
GNU General Public License v3.0
1.06k stars 371 forks source link

Armor Points and Damage Effect #7181

Open aaaeeeMC opened 2 hours ago

aaaeeeMC commented 2 hours ago

Suggestion

I'm surprised we're already in 2.10.0-beta1 and we haven't had this before. The armor points of a player/entity and the damage effect support would be a fantastic addition to the next beta version of 2.10.0. When a player/entity equips armor, their armor points increase, as seen in the armor bar. When wearing full diamond, the armor bar is full, meaning it's at 20 armor points. Let's not forget about armor toughness, which I think makes the armor points more effective. The damage effect currently ignores all armor of an entity no matter what. damage player by 5 will take away 5 hearts from the player even with the best armor. Instead, in the next release, if we really want to make it ignore armor, we can simply specify it: damage player by 5 ignoring armor. We should get a settable expression to get the armor points, maybe even armor toughness or a mashup of both, of an entity. Even though not all entities can be seen with armor, it's actually there, it's just that the armor model doesn't support the entity. My solution for this was to make a custom function for damaging that involved entity1 attacking entity2 with the SkBee effect, and a parameter to set entity1's attack damage attribute before attacking, and back to normal after, but this solution is weird and it doesn't work at all times, which is why... why not add this?

Why?

As stated above, the damage effect ignores all armor. When we want to make, for example, a spike() function that summons a spike from the ground and damages the player by a given amount, well, if we want its damage to be 10 hearts, it's going to insta-kill the player. The problem is, even if the player wears armor, it's still going to be an insta-kill. Full netherite prot 4? Insta-kill. This also applies to other entities. I wouldn't call this feature a bonus, but rather, something that should have been possible since the first days of skripting.

Other

If I somehow am in the wrong, which I highly doubt, I still think this feature should be added, because we don't want to play hide-and-seek with stuff that is to be figured out, do we? And this game of hide-and-seek... it's a tough one. I mean, Skript was made to be as easy and simple as possible, wasn't it?

Oh also, happy late halloween!

Agreement

erenkarakal commented 2 hours ago

We should get a settable expression to get the armor points, maybe even armor toughness or a mashup of both

isn't this already possible with attributes which is already in vanilla?

and ignoring armor would be a breaking change, something like considering armor would have backwards compatibility

aaaeeeMC commented 2 hours ago

isn't this already possible with attributes which is already in vanilla?

here's the thing, the armor attribute doesn't seem to change when i equip armor.

Moderocky commented 11 minutes ago

isn't this already possible with attributes which is already in vanilla?

here's the thing, the armor attribute doesn't seem to change when i equip armor.

You might need to check the innate armor attribute of your player, plus their equipped items (hand, offhand, head, body, legs, boots and filter for attributes that apply to that slot) I don't know whether Bukkit has a built-in method for getting a total effective attribute, though if it does maybe this could be included within attribute syntax somehow.