tModLoader Need help with Mod Accessory

DarkkyCroww

Terrarian
I'm currently working on an accessory that, like the royal gel, makes the player immune to slimes, specifically.
I've already used player.npcTypeNoAggro[x] = true; but the problem I'm facing is that most slimes have a negative ID, generating an error in the code, since I'm using an array with negative indexes.
If there's a way around it, or a solution, I'd like to know
 
Last edited:
For anyone sharing this question, you just need to index the positive id's enemies, since the negative ones are just variants. The negative ID ones have the same parent ID. E.g, red/green/black/purple/yellow slimes and others share the same parent ID(1) with the blue slime
 
Back
Top Bottom