Suggestions please: isUsable ItemAsset property deprecated (C#, Plugin)

Hi, and thanks for reading.

There are some items for which I want to prevent players placing/using them. They are allowed to pick-up those items and craft (with) them, but not allowed to place/use them. Examples are Stealy Wheely and Sandbag.

I currently change the isUsable property of those assets but since it is marked as deprecated I thought it might be smart to find an alternative route. I read it has been “renamed” to canPlayerEquip, but that has a ‘private set’.

If anyone can suggest an approach for me to look into I would be happy. Thanks in advance!

ps. I’m not a developer but a on-line C# course, DNspy, search engine and tons of trying type of guy.

You could check ItemAsset’s public useable string.

1 Like

Thank you for your reply. Maybe my question is formulated badly or I misunderstand your suggestion.

I want to limit the usability of a few items, for that I currently change their isUsable property. Because of the ‘deprecated’ flag I’m looking for an alternative route to control the usability of those items.

(the ‘new’ canPlayerEquip property has a private set)

Thanks again!

Not sure if doing that serverside would prevent the client from equipping it anyways.

For me it works, I use it in my plugin on a few servers. It does exactly what I want but is marked deprecated that’s why I’m looking for an alternative (“route”).

Thanks again!