From 3d3de34e2623f862988134bc193bf75b66ebb76b Mon Sep 17 00:00:00 2001 From: ZXMushroom63 Date: Sun, 8 Dec 2024 16:28:40 +0800 Subject: [PATCH] change death type for the guns --- examplemods/guns.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examplemods/guns.js b/examplemods/guns.js index 27f8336..469d479 100644 --- a/examplemods/guns.js +++ b/examplemods/guns.js @@ -53,12 +53,12 @@ } ModAPI.reflect.prototypeStack(itemClass, nmi_ItemPistol); nmi_ItemPistol.prototype.$onItemRightClick = function ($itemstack, $world, $player) { - var magic = ModAPI.reflect.getClassByName("DamageSource").staticVariables.magic; + var cactus = ModAPI.reflect.getClassByName("DamageSource").staticVariables.cactus; var world = ModAPI.util.wrap($world); var entityplayer = ModAPI.util.wrap($player); var shotentity = entityRayCast(entityplayer, world, 12.0) if (shotentity != null){ - shotentity.attackEntityFrom(magic, 10); + shotentity.attackEntityFrom(cactus, 10); world.playSoundAtEntity(entityplayer.getRef(), ModAPI.util.str("tile.piston.out"), 1.0, 1.8); } return $itemstack;