• Journey's End on PC - Find info here and here. Please report bugs and issues for PC 1.4 and 1.4.1 to Re-Logic here.
  • Journey's End on Mobile - Find info here. Report bugs for Mobile 1.4 to DR Studios at this link and give as much detail as possible.
  • 1.4 will bring many changes to the PC version. We strongly advise making plans to back up your worlds and players prior to updating your game. More details here.
  • Console and Switch - The latest news can be found here. To report a bug, please use this link.

Providing Help for Accessories

berberborscing

Skeletron Prime
I have noticed a lack in interest in the accessories part of Terraria modding. Doesn't it get tiring just creating weapons all day, every day?
Where is the Gravity Coil Mod? Where is the Backpack Mod? Not in the weapons section. So I have a big list of effects I have tested and am sure work.
If one does not work for you, don't hesitate to tell me and I will look into it. So without further ado,

ALL THE VARIOUS PLAYER EFFECTS​
These are all the player effects that can be added to accessories and armor. Some have changed from bools to floats to make some effects more interesting. If you have no idea what I just said, here is a key to help you.
-------------------------------------------------------------------
INT = Integer (Numerical value, e.g. p.breathMax = 400)
BOOL = Boolean (True or False, e.g. p.ignoreWater = true)
FLOAT = Float (Multiplier, e.g. p.meleeDamage = 2f)
--------------------------------------------------------------------
-accCompass [Displays information at top left, how far you are from spawn horizontally] [INT]
-accDepthMeter [Displays information at the top left, tells you your elevation] [INT]
-accDivingHelm [Greatly extends breath as long as the diving helmet does] [BOOL]
-accFishingLine [Untested] [BOOL]
-accFlipper [Lets you swim] [BOOL]
-accMerman [Lets you turn into merfolk when entering water] [BOOL]
-accTackleBox [Decreases chance of losing bait when fishing, higher the number, the less likely] [INT]
-accWatch [Displays the time at the top left of the screen] [INT]
-activeNPCs [Modifies the amount of slots NPCs take up. Lower the multiplier, and more enemies can spawn. Make it very high, and none can spawn] [FLOAT]
-adjHoney [If set to true, you can craft items that require you to be near Honey anywhere when used with adjTile] [BOOL]
-adjLava [Untested] [BOOL]
-adjWater [Untested] [BOOL]
-adjTile [Use in the JSON, makes the game think the player is near a tile] ["adjTile": { "Tile Name" }]
-aggro [Untested] [INT]
-AddBuff [Gives the player a buff, FORMAT: p.AddBuff(ID,DURATION,BOOL)]
-ammoBox [Gives the Ammo Box buff, or 20% chance not to consume ammo] [BOOL]
-ammoCost75 [Gives the player a 25% chance to not consume ammo with any ranged weapon] [BOOL]
-ammoCost80 [Gives the player a 20% chance to not consume ammo with any ranged weapon] [BOOL]
-ammoPotion [Gives the player the ammo potion buff] [BOOL]
-anglerQuestsFinished [Makes the game think you have done the assigned integer of angler quests] [INT]
-archery [Gives the player the Archery buff, which increases arrow damage and speed by 20%] [BOOL]
-armorStealth [Gives the player the Shroomite Armor bonus, which lets you turn invisible after standing still and drastically increases ranged damage] [BOOL]
-arrowDamage [Sets a multiplier for damage of arrow-based weapons] [FLOAT]
-attackCD [Makes your attacks useless unless underwater, unless the value is 0] [INT]
-autoJump [Allows you to keep jumping by holding down the Space Bar] [BOOL]
-autoPaint [Gives the player the Paint Sprayer effect, which automatically paints all blocks placed with any paint in your inventory in order] [BOOL]
-back [Assigns a back texture onto the player] [SBYTE] [SBYTE is just an INT with a max number]
-balloon [Assigns a balloon texture onto the player] [SBYTE]
-bank [Untested] [CHEST] [Not sure what format CHEST is]
-bank2 [Untested] [CHEST]
-bee [Untested] [BOOL]
-beetleBuff [Untested] [BOOL]
-beetleCountdown [Untested] [INT]
-beetleCounter [Untested] [FLOAT]
-beetleDefense [Untested] [BOOL]
-beetleFrame [Untested] [INT]
-beetleFrameCounter [Untested] [INT]
-beetleOffense [Untested] [BOOL]
-beetleOrbs [Untested] [INT]
-blackBelt [Black Belt effect] [BOOL]
-blackout [Blackout debuff] [BOOL]
-bleed [Bleeding debuff] [BOOL]
-blind [Blind debuff] [BOOL]
-blockRange [Sets how far the player can place blocks] [INT]
-blueFairy [Untested, blue fairy bell pet?] [BOOL]
-body [Assigns a shirt texture to the player] [INT]
-bodyRotation [Makes the body rotate at a certain speed] [FLOAT]
-boneArmor [Replaces hurt sounds with skeleton hurt sounds, like Necro Armor] [BOOL]
-breath [Permanently sets breath to value, 200 is max] [INT]
-breathCD [How fast your breath decreases; the higher the number, the faster] [INT]
-breathMax [Sets the maximum amount of breath you can have to value, 400 is double] [INT]
-breathTickMod [Untested] [FLOAT]
-brokenArmor [Sets a multiplier for defense] [FLOAT]
-buffImmune [DOES NOT GO IN CS FILE, GOES IN JSON! FORMAT:[BUFF ID]]
-bulletDamage [Sets a multiplier for damage of bullet-based weapons] [FLOAT]
-bunny [Untested, collector's edition bunny summon?] [BOOL]
-burned [Burned debuff(Gotten from standing on meteorite and hellstone)] [BOOL]
-burnedMoveSpeedMod [Modifies your movement speed while having the burned debuff] [FLOAT]
-calmed [Reduced enemy spawn rate] [BOOL]
-canCarpet [When used in affiliation with p.carpet, it allows for infinite use of Magic Carpet] [BOOL]
-canRocket [When used in affiliation with Rocket Boots, it allows for infinite propulsion] [BOOL]
-carpet [Grants the player the Magic Carpet effect] [BOOL]
-carpetTime [How long you can fly with the Magic Carpet accessory] [INT]
-cartFlip [Untested] [BOOL]
-cartRampTime [Untested] [INT]
-changeItem [Untested] [INT]
-channel [Untested] [BOOL]
-chaosState [Using the Rod of Discord hurts] [BOOL]
-chatShowTime [How long a chat message shows] [INT]
-chatText [Message the chat says] [STRING]
-chest [Makes the player think it's at the chest's ID when you open a chest] [INT]
-chestX [Untested] [INT]
-chestY [Untested] [INT]
-coins [Lucky Coin effect, makes enemies drop more loot and chance to drop coins on attack] [BOOL]
-coldDash [Untested] [BOOL]
-confused [Confused debuff] [BOOL]
-ClearBuff [Clears a debuff] [Use like this: p.ClearBuff("Buff Name", "InternalModName:BuffName", or INT);
-crateChance [Increases the chance of getting a crate while fishing] [FLOAT]
-crimsonRegen [Grants the Crimson armor set bonus, increased life regen] [BOOL]
-crystalLeafDelay [Untested] [INT]
-cSapling [Untested] [BOOL]
-dangersense [Highlights traps] [BOOL]
-dash [Set to any value, and will grant the Tabi effect, double tap A or D to dash] [INT]
-dashDelay [Sets the amount of time you have between each dash, 0 for no limit] [INT]
-dashTime [Sets how long the dash is] [INT] detectCreature [Hunter potion effect, makes enemies glow in darkness] [BOOL]
-dead [If set to false, it will revive the player if applied by an outside source while dead, with all the body parts elsewhere] [BOOL]
-delayUseItem [Untested] [BOOL]
-detectCreature [Highlights enemies] [BOOL]
-difficulty [If 0, softcore death. If 1, mediumcore death but all items disappear. If 2, hardcore death.] [BYTE]
-dino [Untested, dinosaur pet] [BOOL]
-discount [Sets price multiplier for shops] [FLOAT] doubleJump [Cloud in a Bottle effect] [BOOL]
-discountApplied [Untested] [BOOL]
-dJumpEffect [Untested] [BOOL]
-dJumpEffect2 [Untested] [BOOL]
-dJumpEffect3 [Untested] [BOOL]
-dJumpEffect4 [Untested] [BOOL]
-doubleJump [Cloud in a Bottle effect] [BOOL]
-doubleJump2 [Blizzard in a Bottle effect] [BOOL]
-doubleJump3 [Sandstorm in a Bottle effect] [BOOL]
-doubleJump4 [Fart in a Bottle effect] [BOOL]
-drawAfterimage [Draws an afterimage of the player as he moves] [BOOL]
-drawAura [Draws an aura around the player] [BOOL]
-drawGlow [Sparkles the player, like Mythril armor] [BOOL]
-dripping [Water Gun debuff] [BOOL]
-drippingSlime [Slime Gun effect] [BOOL]
-eater [Untested, eater pet] [BOOL]
-editedChestName [Untested] [BOOL]
-endurance [Sets enemy damage with a multiplier, and setting it negative will NOT make them heal you] [FLOAT]
-enemySpawns [Battle potion effect] [BOOL]
-extraFall [Untested] [INT]
-eyeSpring [Untested, eyeball spring pet?] [BOOL]
-face [Assigns a face texture] [SBYTE]
-fallStart [Untested] [INT]
-fallStart2 [Untested] [INT]
-findTreasure [Spelunker effect, treasure glows in the dark] [BOOL]
-fireWalk [Ability to walk on meteorite and hellstone] [BOOL]
-fishingSkill [Sets your fishing power] [INT]
-flameRingRot [Untested] [FLOAT]
-flameRingScale [Untested] [FLOAT]
-flapSound [Untested] [BOOL]
-front [Untested] [SBYTE]
-frostArmor [Frost armor set bonus] [BOOL]
-frostBurn [Frostburn debuff] [BOOL]
-frozen [Frozen debuff] [BOOL] Do you wanna build a
-fullRotation [Rotation speed for whole body] [FLOAT]
-gem [Untested] [INT]
-gemCount [Untested] [INT]
-gfxOffY [Untested] [FLOAT]
-ghost [Turns the player into a ghost as if they died in hardcore, to undo remove effect from acessory/armor] [BOOL]
-ghostDir [Untested] [FLOAT]
-ghostDamage [Sets multiplier for damage done by Spectre Mask armor bonus] [FLOAT]
-ghostFade [Untested] [FLOAT]
-ghostHeal [Spectre Hood armor set, heal 1/10th of magic damage done] [BOOL]
-ghostHurt [Spectre Mask armor set, summons homing orbs that do damage] [BOOL]
-gills [Gills potion effect, unlimited breath underwater, limited breath above water] [BOOL]
-grapCount [Untested] [INT]
-gravControl [Control gravity with W] [BOOL]
-gravControl2 [Gravity globe effect, can only switch gravity after touching a surface] [BOOL]
-gravity [Sets a multiplier for player gravity, set to 0, jump, and never come back down] [FLOAT]
-greenFairy [Untested, green fairy bell pet?] [BOOL]
-grinch [Untested] [BOOL]
-gross [Stinky debuff] [BOOL]
-hair [Sets player's hairstyle] [INT]
-hairDye [Sets hair color] [BYTE]
-handoff [Untested] [SBYTE]
-handon [Untested] [SBYTE]
-hbLocked [Locks the hotbar] [BOOL]
-head [Assigns a helmet texture to player] [INT]
-headRotation [Sets a rotation speed for your head] [FLOAT]
-heldProj [Untested] [INT]
-honey [Increased life regeneration] [BOOL]
-hornet [Untested, hornet pet?] [BOOL]
-hornetMinion [Untested, hornet minion summon?] [BOOL]
-iceBarrier [Frozen Turtle Shell effect[
-iceSkate [Ice Skate ability or decreases ice slippiness, faster movement on ice, and falling on ice won't break it] [BOOL]
-ichor [-20 defense] [BOOL]
-ignoreWater [Mobility is not hindered underwater, but jumping underwater is much higher] [BOOL]
-immune [When set to true, you cannot be attacked, infinite Cross Necklace effect] [BOOL]
-immuneAlpha [Untested, immunity transparency?] [INT]
-immuneTime [Set how long you are invincible after being attacked] [INT]
-impMinion [Untested, imp minion summon?] [BOOL]
-invis [Makes the player invisible, armor is still visible and enemies can still see you] [BOOL]
-itemAnimation [Untested] [INT]
-itemAnimationMax [Untested] [INT]
-itemFlameCount [Untested] [INT]
-itemTime [Changes all items useTime's to a set value, the lower the faster] [INT]
-itemHeight [Untested] [INT]
-itemRotation [Untested] [FLOAT]
-itemWidth [Untested] [INT]
-jump [Set to 0 to reduce jumping, set to 1 to infinitely jump once in mid-air] [INT]
-jumpAgain [Untested] [BOOL]
-jumpAgain2 [Untested] [BOOL]
-jumpAgain3 [Untested] [BOOL]
-jumpAgain4 [Untested] [BOOL]
-jumpBoost [Shiny Red Balloon effect, increases jump range from 5 blocks to 8] [BOOL]
-jumpSpeedBoost [Modifies how fast you rise when you jump, and therefore jumping distance increases] [FLOAT]
-justJumped [When paired with any bottle accessories, infinite double jumping] [BOOL]
-killGuide [Can attack guide] [BOOL]
-killClothier [Can attack clothier] [BOOL]
-knockbackMeleeMod [Modifies how much knockback melee weapons deal] [FLOAT]
-knockbackMeleeModApplied [Untested] [BOOL]
-knockbackMod [Modifies how much knockback any weapon deals] [FLOAT]
-knockbackResist [Modifies how much knockback you take from mobs, the higher, the more knockback you take] [FLOAT]
-lastMouseInterface [Untested] [BOOL]
-lavaCD [Untested] [INT]
-lavaMax [Lava charm effect, makes you immune to lava for set time, 60 is one second, lava charm effect has this value as 420, if you want it to stack with that put p.lavaMax += INT] [INT]
-lavaImmune [Makes the player take no damage from lava] [BOOL]
-lavaRose [Modifies how much damage players take from lava] [FLOAT]
-lavaRoseApplied [Untested] [BOOL]
-lifeForce [Increases life by 20%] [BOOL]
-lifeMagnet [Increases pick-up range for life hearts to 22 blocks] [BOOL]
-lifeRegen [Modifies life regeneration] [INT]
-longInvince [Cross Necklace effect, doubled invicibility period after an attack] [BOOL]
-luckMax [Sets a multiplier for the max amount of money acquired from the Lucky Coin effect] [FLOAT]
-luckMin [Sets a multiplier for the minimum amount of money acquired form the Lucky Coin effect] [FLOAT]
-magicCrit [Sets the chance for magic weapons to crit, better as "p.magicCrit += INT"] [INT]
-magicCritMult [Sets a multiplier for how much damage a critical hit on a magic weapon does, default is 2f] [FLOAT]
-magicCuffs [Magic Cuffs effect, increases max mana by 20 and regens mana when hurt] [BOOL]
-magicDamage [Sets a multiplier for how much damage magic weapons deal] [FLOAT]
-magicQuiver [Magic Quiver effect, increases arrow damage and speed by 10%, and gives a 20% chance not to consume arrows] [BOOL]
-magmaStone [Magma Stone effect, varying fire effects from melee attacks] [BOOL]
-male [Sets gender to male permanently if true, sets gender to female permanently if false, can be changed with a buff like p.ghost] [BOOL]
-manaCost [Sets multiplier for how much mana magic weapons use up] [FLOAT]
-manaFlower [8% reduced mana usage and automatic drinking of mana potions, Mana Flower Effect] [BOOL]
-manaMagnet [Increases pick-up range for mana stars to 22 blocks] [BOOL]
-manaRegen [Modify mana regeneration] [INT] maxFallSpeed [Sets a multiplier for terminal velocity] [FLOAT]
-maxMinions [Use p.maxMinions += INT to add to the number of max minions] [INT]
-meleeCrit [Sets the crit chance for melee weapons, better as "p.meleeCrit += INT"] [INT]
-meleeCritMult [Sets a multiplier for how much damage a melee weapon does on a crit, 2f is default] [FLOAT]
-meleeDamage [Sets a multiplier for how much damage melee weapons deal] [FLOAT]
-meleeSpeed [Sets a multiplier for how fast you swing melee weapons] [FLOAT]
-minionDamage [Sets a multiplier for summoner minion damage] [FLOAT]
-moveSpeed [Sets a multiplier for player movement speed] [FLOAT]
-moveSpeedMax [Sets a multiplier for player top speed] [FLOAT]
nightVision [Night Vision buff] [BOOL]
-noFallDmg [Lucky Horseshoe effect, fall damage won't be an issue] [BOOL]
-noItems [Cursed effect, no items can be used] [BOOL]
-onHitDodge [Titanium Armor bonus, has a chance to activate Shadow Dodge upon hit] [BOOL]
-onHitPetal [Orichalcum Armor bonus, petals fly in and attack upon attack] [BOOL]
-onHitRegen [Palladium Armor Bonus, chance to regen health quickly upon hit] [BOOL]
-pickSpeed [Sets a multiplier for how fast pickaxes mine] [FLOAT]
-rangedCrit [Sets the chance for ranged weapons to crit, better as "p.rangedCrit += INT"] [INT]
-rangedCritMult [Sets a multiplier for how much damage ranged weapons do on a crit] [FLOAT]
-rangedDamage [Sets a multiplier for how much damage ranged weapons do] [FLOAT]
-rocketBoots [Set to 1 for Rocket Boots, 2 for Spectre Boots] [INT]
-rocketDamage [Sets a multiplier for rocket-based weapon damage] [FLOAT]
-rulerAcc [Ruler effect, makes everything a grid for easier building] [BOOL]
-scope [Ability to see off screen] [BOOL]
-slotsMinions [Sets multiplier for the amount of slots minions take, the lower the multiplier, the more minions] [FLOAT]
-slowFall [Feather-falling effect, press S to fall quicker] [BOOL]
-spikedBoots [Set to 1 for slide-down walls, Set to 2 for hang-on walls] [INT]
-starCloak [Star Cloak effect, stars fall down upon being damaged] [BOOL]
-statDefense [Use p.statDefense += INT to add to player's defense] [INT]
-statLife [Restrains life to that number, does not impact max] [INT]
-statLifeMax2 [Use p.statLifeMax2 += INT to add to player's max life] [INT]
-statManaMax2 [Use p.statManaMax2 += INT to add to player's max mana] [INT]
-thorns [Multiplies the damage enemies deal to you and deal it back upon contact, 0.3f for thorns potion and 1f for turtle armor effect] [FLOAT]
-tileRangeX [Sets how far you can mine horizontally] [INT]
-tileRangeY [Sets how far you can mine vertically] [INT]
-waterWalk [Lets you walk on water AND lava] [BOOL]
-waterWalk2 [Lets you walk on water, but not lava] [BOOL]
-zoneBlood [Makes game think you are in the Crimson] [BOOL]
-zoneDungeon [Makes game think you are in the Dungeon] [BOOL]
-zoneEvil [Makes game think you are in the Corruption] [BOOL]
-zoneHoly [Makes game think you are in the Hallow] [BOOL]
-zoneJungle [Makes game think you are in the Jungle] [BOOL]
-zoneMeteor [Makes game think you are in a Meteor Biome] [BOOL]
-zoneSnow [Makes game think you are in a Snow Biome] [BOOL]
END OF EFFECTS LIST​


Some people learn better by example rather than by information. Here is an example of an accessory CS file:
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;
using TAPI;
using Terraria;
namespace InternalModName.Items //replace InternalModName with the internal name of your mod
{
   public class ItemName : ModItem //replace ItemName with the name of your accessory
   {
  public override void Effects(Player p) //Where it says "p" is the variable used to represent "player". In this case, every p stands for player. This is called when the accessory is on.
     {
       p.noFallDmg = true;  //This is where an effect from the list goes.
     }
    public override void DamageNPC(Player p, NPC n, int hitDir, ref int damage, ref float knockback, ref bool crit, ref float critMult) //This is called when the player attacks an NPC
     {
       p.statLife += 5; //any effect goes here, this gives the player 5 life upon attack of any NPC
     }
     public override void DamagePlayer(NPC n, Player p, int hitDir, ref int damage, ref bool crit, ref float critMult) //This is called when the player is damaged by an NPC
     {
       p.panic = true; //This would give the player the panic buff when hit by the NPC
     }
   }
}

There are probably simpler ways of performing some things in this list (like putting "defense": 6 into the JSON rather than p.statDefense += 6)
And some effects are missing because they can be obtained through the p.AddBuff method.
Next up is creating a projectile / dust. Make sure that if it isn't using a statement that restricts firing speed of this projectile, that it's timeLeft is extremely low, or it will cause lag.
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

using TAPI;
using Terraria;

namespace InternalModName.Items
{
    public class ItemName : ModItem
    {
        public override void Effects(Player p)
        {
            if(p.statLife <= (int)p.statLifeMax/5) //If life is less than 1/5th of max...
            {
                if (Main.rand.Next(250) == 0) //On a 1/250 chance every tick, it'll spawn a projectile (to prevent lag)
                {
                    Projectile.NewProjectile(p.position.X, p.position.Y, 0f, 0f, ProjDef.byName["InternalModName:ProjectileName"].type, 5, 0f, p.whoAmI, 0f, 0f); //Parameters are in this order: (Projectile Origin Position X Coordinate, Projectile Origin Position Y Coordinate, Speed in the X Direction, Speed in the Y Direction, Projectile ID or name, Damage, Knockback, unknown Vector2, unknown float, unknown float)
                    Dust.NewDust(p.position.X, p.position.Y, 0f, 0f, Dust ID,
                }
            }
        }
    }
}
This can also be added into other hooks, such as DamagePlayer and DamageNPC to spawn a projectile when you hit an NPC or get hit.
Have fun creating accessories!
 
Last edited:

berberborscing

Skeletron Prime
But that will give ALL the wing's buffs, not just the noclip mode. So there's no way to just tie into the no clip ability directly?
I have never observed that noclip effect, but it's probably hard-coded into the wings.
I would suggest a tool that grants you a custom buff with the p.ghost effect, and make it turn you into a player when cancelled.
I'm at school right now, but I can upload working ghost buff code when I return.
 
I did a little code-digging, and it does seem to be a hard-coded function of wingslot-3, aka Red's wings. I don't know much about how Tapi works, could it inject some sort of callable flag into that part of the code to allow other items to access that function?
 

Shockah

Grandson of The Wizard
To begin with, adding ways of obtaining dev items is prohibited, so that's a no.
You can't randomly call some code in the game, not one in the middle of a method. So another no.
You can SIMULATE IT though. That's the thing my Fancy Cheat Menu does. Keep in mind it's nothing simple. Also, it's buggy a little.
 
I'm not trying to get the dev items, I'm just trying to make something that has one the functions of a dev item. Namely, that you can press up and down at the same time and go through walls. But it sounds like Tapi isn't capable of accessing it directly, which is a shame. I wanted the make a sort of "phase device" accessory that let you go through walls.
 

berberborscing

Skeletron Prime
Back from school, here's the code for a ghost buff
I put this up because after you are a ghost it's difficult to undo, but if it is in buff form it is easy to return to human form. This does not effecthardcore player death whatsoever.

Here is the Buff JSON:
Code:
{
    "displayName": "Ghost", //buff name
    "tip": "Deactivate to return to human form", //Buff version of tooltip
    "debuff": false, //makes it disable-able
    "vanityPet": false, //don't worry about this
    "lightPet": false, //don't worry about this either
    "enchantment": false, //not sure what this is
    "noTimer": true //makes the buff show no timer
}
And here is the buff CS:
Code:
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;

using TAPI;
using Terraria;

namespace berberborscing.Buffs //replace "berberborscing" with the your mod's internal mod name, you can find it in ModInfo.json if you don't know it
{
    public class Ghost : TAPI.ModBuff
    {
        public override void Effects(Player p, int index) //called when the buff starts
        {
            p.ghost = true; //turns the player into a ghost
        }
        public override void End(Player p, int index) //called when the buff is cancelled
        {
            p.ghost = false; //turns the player back
        }
    }
}
But there is no way to get the buff in-game yet. You need something to give you the buff.
Here is an example JSON:
Code:
{
    "displayName": "Tome of Souls", //name of tool
    "size": [28,32], //size of texture
    "useStyle": 4, //This usestyle holds the book up into the air
    "useAnimation": 17, //This does not matter
    "useTime": 17, //Neither does this
    "maxStack": 1, //The max amount of this you can have in one slot
    "useSound": 17, //Use Item sound, this is the hornet stinger sound
    "tooltip": "Turns you into a ghost until deactivating buff",
    "rare": 4, //Rarity level
    "value": [1,0,0,0], //How much it costs to buy it, divide by 5 to find the sell price
    "buff": "berberborscing:Ghost", //replace "berberborscing" with your internal mod name
    "buffTime": 600, //this does not matter because p.ghost does not have a functioning timer
 
    "recipes": //replace whatever is below with what you want
    [{
        "items": { "Spell Tome": 1, "Ectoplasm": 10, "Soul of Fright": 30, "Soul of Flight": 5 },
        "tiles": [ "Bookcase" ],
        "creates": 1
    }]
}
If you want a potion to give you this buff, make a potion sprite, and add the line
"consumable": true,
after the line
"buffTime": 600
Change the "size" line accordingly to the potion item sprite.
 
Last edited:

berberborscing

Skeletron Prime
Changelog: Added some new effects, such as AutoJump, Melee/Ranged/MagicCrit, and added the DamageNPC hook to the CS example.
ALSO organized the list into a spoiler and added the Lava Charm effect, called p.lavaMax
 
Last edited:

composter

Terrarian
Is it realy to create accessory that i can keep in inventory and don't need to put it in accessory's slot?
What property has Brick Layer ?
 

berberborscing

Skeletron Prime
Is it realy to create accessory that i can keep in inventory and don't need to put it in accessory's slot?
What property has Brick Layer ?
I get that English is not your first language. An accessory that you don't equip in the accessory slot would not be an accesory, it would be an item, therefore impossible to provide effects unless the item were used.
For the Brick Layer accessory effect, you would do
Code:
p.AddBuff (107,60,true); //107 is the Builder buff ID, 60 is one second
If you wanted an item to grant you this effect, you would use this code:
Code:
public override void useItem(Player p)
{
          p.AddBuff (107, 18000, true); //This code would give you the Builder buff for 5 minutes.
}
 

Arkamirade

Skeletron Prime
EDIT: I am here to ask one thing:
Can minion damage etc be used in a prefix json? If so, in what format? I tried the "minionDamage": += Number but it says it has an unnecessary + in. Sorry but I'm really bad at coding.
I would very much appreciate it if this question was answered.
 
Last edited:

berberborscing

Skeletron Prime
I am here to ask two things, just to avoid a double post:
1.How can I make a vanilla enemy/boss have an additional drop? I want this to make the Wall of Flesh have a chance to drop the Flesh Wings mod item I made. They would be the worse wings in the game, but they would still help an 'entering hardmode' player.
2.Can minion damage etc be used in a prefix json? If so, in what format? I tried the "minionDamage": += Number but it says it has an unnecessary + in. Sorry but I'm really bad at coding.
I would very much appreciate it if these questions were answered.
1.Irrelevant to this thread, but someone on the tAPI thread can help you.
2. minionDamage is a float, not an int. For example,
Code:
"minionDamage": 1.3f; //30% increased summoner damage
 

Arkamirade

Skeletron Prime
1.Irrelevant to this thread, but someone on the tAPI thread can help you.
2. minionDamage is a float, not an int. For example,
Code:
"minionDamage": 1.3f; //30% increased summoner damage
Thanks, sorry about the first request. One more thing, it say I've got an irrivelent '+' sign when I do:
"p.maxMinions" += 1
I put it in the prefix json, if you could help that would be great. Gee, I am bad at modding.
 

berberborscing

Skeletron Prime
Thanks, sorry about the first request. One more thing, it say I've got an irrivelent '+' sign when I do:
"p.maxMinions" += 1
I put it in the prefix json, if you could help that would be great. Gee, I am bad at modding.
p.maxMinions isn't JSON code, it's CS, unless this was a typo
 
Top Bottom