Time for some guesswork
If you want to stick strictly to json, the only 2 ways I see to inflict a buff from an entity is through a ranged projectile or a consumable.
Here’s the meat of it in slow_arrow_skill.json
"entity_data": {
"stonehearth:buffs": {
"inflictable_debuffs": {
"infection": {
"uri": "stonehearth:buffs:archer:slowing_arrow",
"chance": 1
}
}
}
}
I would assume that if we were to add that to the trap itself, any interaction would inflict the buff, so whoever places it would get that buff as well, but I could be completely wrong. Assuming that is true, my thought process is
- Make another projectile entity based on the arrow, and use an empty .qb file. Use the slowing_arrow buff, or create your own.
- Add ranged paramaters to the [trapname]_weapon.json stonehearth:combat:weapon_data{}
Additions could go something like this:
[trapname]_weapon.json
"stonehearth:combat:weapon_data": {
"base_damage": 50,
"reach": 1.5
"base_ranged_damage": 0,
"range": 1,
"projectile_speed": 30,
"projectile_uri": "[newProjectileURI]",
"projectile_start_offset": { "x": 0, "y": 2.3, "z": 0 },
"projectile_end_offset": { "x": 0, "y": 2.3, "z": 0 }
},
"stonehearth:combat:ranged_attacks": [
{
"name": "shoot",
"effect": "shoot", <- Might be able to remove so there's no animation
"active_frame": 20,
"cooldown": 0,
"priority": 0
}
]
[trapname].json
"mixins": [
"stonehearth:mixins:siege_turret"
]
"components": {
"stonehearth:siege_weapon": { <-
"max_uses": 1 <-- Might not need
}, <-
"stonehearth:equipment": {
"items": [
"URI you set for [trapname]_weapons.json"
]
},
"sensor_list": {
"sensors": {
"sight": {
"type": "sensor",
"radius": 2
}
}
}
}
In theory it might work…