
RangedJS: KubeJS Addon
Активный0.0
Установок
0
Последнее обновление
1 неделю назад
Клиент
Оружие и броня
A KubeJS addon for pack dev to easily create custom bows. It adds bow pulling animation upon registry, which is not done by basic KubeJS. Example:
StartupEvents.registry("item", event => {
event.create("test_bow", "bow").bow(bow => {
bow.modifyBow(attributes => {
attributes
.fullChargeTicks(40) //takes 40 ticks to full charge
.flamingArrow() //shoot flaming arrows by default
.baseDamage(5) //base damage is set to 5 (the default is 2.0)
.power(1)
})
.onArrowHit(arrow => {
arrow.hitEntity(event => {
const {entity} = event
if(entity.type == "minecraft:villager"){
event.cancel() //the arrow will go through villager without causing damage or effect
}
else{
entity.block.createEntity("minecraft:lightning_bolt").spawn()//create lighting bolt when hit entity
}
})
arrow.hitBlock(event => {
const {block} = event
if(block.id == "minecraft:tnt") event.cancel() //prevent tnt from being ignited by the arrow
})
})
})
})
Planning to add more options for customization.
Planning to support for crossbow and perhaps gun and beam weapons in the future.