If you just want to test out some modded items or cheat in items to play pranks on your friends, the in game admin menu makes this easy for you, without having to run any complex command you need to remember. Here's how you can spawn in any item to your Project Zomboid server.
1. Login to the game as an admin
2. Open the admin panel
3. Click Items List Viewer
4. Here, you'll see a list of all items available in your game. You can add any amount to your inventory.
5. Now, spawn in as many broccoli as you can. (we're just kidding… :|).