jaractus
Ice Queen
Hi I'm getting an error for my modded pet.
This is the error:
Mod Sources\MageIsland\Projectiles\Pets\PossesedPlush.cs(26,20) : error CS1061: 'Terraria.Player' does not contain a definition for 'cursedsapling' and no extension method 'cursedsapling' accepting a first argument of type 'Terraria.Player' could be found (are you missing a using directive or an assembly reference?)
Here is the code:
I've tried doing numerous things, but they don't work. Is "cursedsapling" the wrong thing to put there?
Any help is nice.
EDIT: The "cursedsapling" is a Relic from the aiType according to Example Mod.
This is the error:
Mod Sources\MageIsland\Projectiles\Pets\PossesedPlush.cs(26,20) : error CS1061: 'Terraria.Player' does not contain a definition for 'cursedsapling' and no extension method 'cursedsapling' accepting a first argument of type 'Terraria.Player' could be found (are you missing a using directive or an assembly reference?)
Here is the code:
Code:
using System;
using Microsoft.Xna.Framework;
using Terraria;
using Terraria.ID;
using Terraria.ModLoader;
namespace MageIsland.Projectiles.Pets
{
public class PossesedPlush : ModProjectile
{
public override void SetStaticDefaults()
{
Main.projFrames[projectile.type] = 1;
Main.projPet[projectile.type] = true;
}
public override void SetDefaults()
{
projectile.CloneDefaults(ProjectileID.CursedSapling);
aiType = ProjectileID.CursedSapling;
}
public override bool PreAI()
{
Player player = Main.player[projectile.owner];
player.cursedsapling = false;
return true;
}
public override void AI()
{
Player player = Main.player[projectile.owner];
MagePlayer modPlayer = player.GetModPlayer<MagePlayer>(mod);
if(player.dead)
{
modPlayer.possesedPlush = false;
}
if (modPlayer.possesedPlush)
{
projectile.timeLeft = 2;
}
}
}
}
I've tried doing numerous things, but they don't work. Is "cursedsapling" the wrong thing to put there?
Any help is nice.
EDIT: The "cursedsapling" is a Relic from the aiType according to Example Mod.
Last edited: