Kick/Ban when being hit by a stick?

I would like a way to hit a player and when they are hit it reads as /kick [Username] or /ban [Username].
12 Replies
Admincraft Meta
Admincraft Metaβ€’2w ago
Thanks for asking your question!
Make sure to provide as much helpful information as possible such as logs/what you tried and what your exact issue is
Make sure to mark solved when issue is solved!!!
/close !close !solved !answered
Requested by yoiloki#0
γ€Žπ˜πš˜π’π™»π¨πš”π’γ€
Solutions, explain to me like I'm a child or simpler terms. Idk understand the terms when devopling plugins, I just repeat code or attemp to learn it.
Deathpacito
Deathpacitoβ€’2w ago
Is this an announcement to the whole server? Who can see the message? Do you want it to run multiple commands or just one (Aka announce the message AND ban or just either one) Are you trying to develop the plugin yourself or looking for existing solutions? If existing, are you fine with paid plugins?
kakk
kakkβ€’2w ago
Probably achievable with Skript. There is surely a damage event that you can listen to, check the item the attacker is holding and kick the victim if its a stick. https://skripthub.net/docs/?id=1004 maybe something like
on damage of player by player:
if attacker is holding stick:
kick victim
on damage of player by player:
if attacker is holding stick:
kick victim
Skript Hub - Documentation
On Damage (Event) - Skript
Called when an entity receives damage, e.g. by an attack from another entity, lava, fire, drowning, fall, suffocation, etc.
kakk
kakkβ€’2w ago
See the example code on the linked page. You can add conditions like the stick has to have a specific name etc.
α²Ό
α²Όβ€’2w ago
You can use conditional events plugin for this. It is less resource intensive than script and is like easier to understand
Zerek
Zerekβ€’2w ago
Perhaps require the stick to have some specific name or lore, and restrict to players which a specific permission?
Snow Kit
Snow Kitβ€’2w ago
so essentials' powertool?
No description
Snow Kit
Snow Kitβ€’2w ago
I mean, you’d want to check if they have permissions (because creative mode lets people spawn items with custom nbt/lore) and if you’re writing a custom plugin, then these days you should use a PersistantDataContainer
γ€Žπ˜πš˜π’π™»π¨πš”π’γ€
This saves me time for creating a plugin, thxs !solved
Admincraft Meta
Admincraft Metaβ€’2w ago
Closed post!
Your post has been marked as solved!
Requested by yoiloki#0

Did you find this page helpful?