tModLoader tModLoader, CS0103 Error

eX_y

Terrarian
Some of you may have seen my previous post on my custom accessory, I made some improvements to it and found a very helpful document which shows you every single class for coding (it's updated too!).
But anyways let's get in to the problem, while making the On-Hit Effect it gave me the CS0103 error, the image down below (attachments) shows the source, the code and the error, anyone can help?

Also the link to the source page: Terraria ModLoader: Terraria.ModLoader.ModPlayer Class Reference
 

Attachments

  • ProblemPlayer.png
    ProblemPlayer.png
    135.3 KB · Views: 84
The error occours because you are trying to access the Player variable in the onHitByNpc function. This function however doesn´t have a parameter called player nor is there a player variable declared in your Item class. Its like using a smartphone while not having one. If you desire to learn more about this take a look at the microsoft documentation for c#.

I hope this explanation is understandable. Have a nice day!
 
Back
Top Bottom