Jump to content

Command Questions


Recommended Posts

Is there a command that allows me to count the quantity of an object in the world? For instance, if I wanted to count how many cactus, or stonefruit, or even trees, how would I do that? 

Also, is there a command to look at an item and give you the code to spawn it? The wiki does not always have the spawning code. 

 

Link to comment
https://forums.kleientertainment.com/forums/topic/158916-command-questions/
Share on other sites

If you want to check an item's prefab, you can do so with this command while hovering your cursor over the item. Ignore the number to the left, you only care about the text:
c_announce(c_select())

Alternatively, you can find prefab names on the wiki (use .gg, not fandom) under the item info card, like so:
image.png.63a9dab2efdd00ece72fd1e57e8881b3.png

To spawn an item, use either of these:
c_spawn("prefab")
c_give("prefab")

c_spawn creates a prefab on your cursor, c_give puts the prefab into your inventory. If you want to spawn multiple items, just add a comma and the amount you want to spawn after "prefab". Here's an example:
c_give("rope", 20)

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...