DerpySquidII
Terrarian
How do I make it so an NPC inflicts a buff on me with a 1 in 3 chance?
using System;
using Terraria.ID;
using Terraria.ModLoader;
namespace Test.Items
{
public class FlamefrostBlade : ModItem
{
public override void SetStaticDefaults()
{
Tooltip.SetDefault("The perfect blend of Ice and Magma.");
}
public override void SetDefaults()
{
item.damage = 35;
item.melee = true;
item.width = 40;
item.height = 40;
item.useTime = 10;
item.useAnimation = 10;
item.useStyle = 1;
item.knockBack = 4;
item.value = 10000;
item.rare = 2;
item.UseSound = SoundID.Item1;
item.autoReuse = true;
}
public override void AddRecipes()
{
ModRecipe recipe = new ModRecipe(mod);
recipe.AddIngredient(ItemID.Shiverthorn, 15);
recipe.AddIngredient(ItemID.Fireblossom, 15);
recipe.AddIngredient(ItemID.AshBlock, 150);
recipe.AddIngredient(Mod.ItemType("Magma Bar"), 10);
recipe.AddTile(TileID.Anvils);
recipe.SetResult(this);
recipe.AddRecipe();
}
}
}
Assuming you have an item with the class "MagmaBar", change this line:i really need help with my code please help. i keep getting the error " An object reference is required for the non-static field, method, or property 'Mod.ItemType(string)' "
Here is the code
<snip>
You could use their number ID, because demon altars are corruption only. The IDs are 26, and for crimson 26 (2)what do you put in this line to make it crafted at a demon altar?
i also tried EvilAltar and EvilAltars and i cant figure it outCode:recipe.AddTile(TileID.DemonAltar);
It works now and i didnt even change it, I don't know how that makes sense, but whatever. Thanks for reminding me to make a crimson one, because i would definitely forget it otherwise.You could use their number ID, because demon altars are corruption only. The IDs are 26, and for crimson 26 (2)
Thanks, but now i get the error "Mod is a namespace but is used like a type"Assuming you have an item with the class "MagmaBar", change this line:
recipe.AddIngredient(Mod.ItemType("Magma Bar"), 10);
to this:
recipe.AddIngredient(ModContent.ItemType<MagmaBar>(), 10);
using Terraria.ModLoader;
namespace Test
{
public class Test : Mod
{
}
}
Your welcome. I’m new to modding but from what I’ve seen number IDs work, and words or numbers in parenthesis are usually not spaced from the actual ID.It works now and i didnt even change it, I don't know how that makes sense, but whatever. Thanks for reminding me to make a crimson one, because i would definitely forget it otherwise.
If you look up tile “bools” you can see that light is Shine, or Shine2, since I have not coded I do not know how to make it shine, but you could most likely find a tutorial or use example mod. I’m not sure if liquid is the same or different.How do you change the properties of a vanilla tile? For instance, make it produce light? And is it the same for fluids, like water or lava?
Oh, and enable only one at a time (I eventually realized that) they don't work well togetherI was able to make my tmodloader work and i also downloaded a few mods. But for some reason when im making a world with thorium mod enabled, it crashes. And when i initialize calamity mod, it also crashes. Maybe it was because of my 2gb ram, is there any good mod you can recommend that doesnt take much memory