Raft Modding
Back to raftmodding.com
Search…
⌃K
Links
Welcome to the RaftModding docs!
TUTORIALS
How to install RaftModLoader
How to configure your antivirus
How to install a mod
Mods in multiplayer
How to run multiple raft instances
MODDING TUTORIALS
How to create a mod project
How to create an AssetBundle
How to create console commands
Harmony basics
Getting access to the modding repositories
Client - API
RAPI
Mod Events
Client - Code Examples
Reading private variables
Modifying private variables
Adding private variables
Accessing the player instance
Giving items to a player
Dropping/Spawning items
Printing to the console
Execute code on world loading
Get the current SteamID
Get the current username
Get selected hotbar item
Website
Slugs
Server - API
Coming soon!
Server - Code examples
Coming soon!
Powered By GitBook

Dropping/Spawning items

To drop/spawn an item we use the DropItem method from the Helper class.
Network_Player player = RAPI.GetLocalPlayer();
Item_Base item = ItemManager.GetItemByName("Raw_Potato");
Helper.DropItem(new ItemInstance(item, 1, item.MaxUses), player.transform.position, player.CameraTransform.forward,player.transform.ParentedToRaft());
Client - Code Examples - Previous
Giving items to a player
Next - Client - Code Examples
Printing to the console
Last modified 2yr ago
Copy link