Trouble with confusion active item
basically the active item is supposed to cause confusion when used but i can´t get it to work heres the code:
local mod=RegisterMod("giges", 1)
local gigesRing=Isaac.GetItemIdByName("giges ring")
local player=Isaac.GetPlayer(playerIndex)
local ringDuration=10000
function mod:RingUse(item)
local roomEntities = Isaac.GetRoomEntities()
for _, entity in ipairs(roomEntities) do
if entity:IsActiveEnemy() and entity:IsVulnerableEnemy() then
entity:AddConfusion(
EntityRef(player),
ringDuration, true)
end
end
return {
Discharge = true,
Remove = true,
ShowAnim=true
}
end
mod:AddCallback(ModCallbacks.MC_USE_ITEM, mod.RingUse, gigesRing)