AmmunitionCodBeeDuster
Terrarian
It was at that moment I realised, I had been doing everything wrong.
Did you make sure the folder name is "Items" other than Item?I attempted to make something, it worked in the Compiler, but... I can't craft it in game.
Did you make sure the folder name is "Items" other than Item?
Nice.I already got everything working, and my mod is currently W(H)IP with 17 items so far (3 accessories! YAY)
Nice.
Maybe. What is it?I have a question that you can hopefully answer.
using System; using System.Collections.Generic; using Microsoft.Xna.Framework; using Microsoft.Xna.Framework.Graphics; using TAPI; using Terraria; namespace berberborscing.Items { public class Modbase : ModBase //Use ModBase instead of Items. { public override void OnLoad() //This will call the code when you load up the game. { Recipe.newRecipe.createItem.SetDefaults(1309, false); //This is where the item you want to add a recipe to goes. "1309" is the ID of the Slime Staff. Recipe.newRecipe.createItem.stack = 1; //This is how many are produced by this recipe. Recipe.newRecipe.requiredItem.Add(new Item().SetDefaults(9, false)); //This is the first item used in the recipe. "9" is the ID for Wood. Recipe.newRecipe.requiredItem[0].stack = 15; //This is how much Wood we need, 15. the [0] notes that this is the first material in the recipe. Recipe.newRecipe.requiredItem.Add(new Item().SetDefaults(23, false)); //This is the second item used in the recipe. "23" is the ID for Gel. Recipe.newRecipe.requiredItem[1].stack = 80; //We need 80 Gel. The [1] means it is the second material in the recipe. It goes up from there. Recipe.newRecipe.requiredItem.Add(new Item().SetDefaults(29, false)); //"29" is the ID for Life Crystal. Get it now? Recipe.newRecipe.requiredItem[2].stack = 1; //We need 1 Heart Crystal. Recipe.newRecipe.requiredTile.Add(18); //This is where the crafting station you need goes. "18" is the ID for the Work Bench. Recipe.AddRecipe(); //This tidbit of code adds the recipe into the game. } } }
I'm not completely sure, but are you using that to make the recipe for your mod items?Can I put multiple New Item recipes in here?
I'm not completely sure, but are you using that to make the recipe for your mod items?
I seeNo. I'm adding a new rec... holy crap, I made a terrible mistake.
I see
Oh okay, but if you're using the code for a recipe for non-mod items then just copy and make a new one for each item. I guess.Never mind, I thought I'd replaced the recipe for mechanical worm. Only added a new one!
In the "Projectiles" folder.I don't put projectiles in the Items folder, where do I put them?
In the "Projectiles" folder.
Yes, in the same folder the "Items" folder is on. What kind of mob? A vanilla one, or a modded one?Which would be "next to" the Items folder (in the same folder as it), correct? Also, how do I make something drop from a mob?
Yes, in the same folder the "Items" folder is on. What kind of mob? A vanilla one, or a modded one?
Save this as MNPC.cs in the same folder as "ModInfo.json"Vanilla.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.Xna.Framework;
using Terraria;
using TAPI;
namespace InternalModName
{
[GlobalMod]
public class MNPC : ModNPC
{
public override void PostNPCLoot()
{
if(npc.type == 3) //Replace the number with the ID of the mob you are making drop from. Separate numbers with " || "
{
if(Main.rand.Next(1, 100) == 1) //Chance of the item dropping. In this case, 1 in 100 chance
{
Item.NewItem((int)npc.position.X, (int)npc.position.Y, npc.width / 2, npc.height / 2, ItemDef.byName["InternalModName:ItemName"].type, 1, false, 0);
}
}
}
}
}
Save this as "ItemName.cs" in the same folder as the armor.How would i go about making a boomerang that acts like the razorblaze? Meaning like i would throw it and it would bounce to enemies and return to me? And if it could have the effect like shadow armor when it moves, is that possible?
using System;
using System.Collections.Generic;
using System.Text;
using System.Diagnostics;
using TAPI;
using Terraria;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
namespace InternalModName.Items
{
public class ItemName : ModItem
{
public override void ArmorSetBonus(Player p)
{
p.drawAura = true; //Pulsating Effect
p.drawAfterimage = true; //Afterimage
}
}
}