public AddBuff ( int type, int time1, bool quiet = true ) : void | ||
type | int | |
time1 | int | |
quiet | bool | |
return | void |
player.AddBuff(BuffID.Regeneration, 1800);
ModItem item = new ModItem(); // Create a new mod item int buffID = item.BuffType("CustomBuff"); // Get the ID of the custom buff player.AddBuff(buffID, 3600); // Add the custom buff to the player for 1 minute (3600 ticks)In this example, we are creating a custom buff using a mod item, and then adding it to the player. The package/library used for this code is likely Terraria.ModLoader.API. This library is used for creating mods and custom content in Terraria.
public AddBuff ( int type, int time1, bool quiet = true ) : void | ||
type | int | |
time1 | int | |
quiet | bool | |
return | void |