Tool Terraria Item Modifier - A patch for advanced item customization.

trigger_segfault

Spazmatism
T8YhLa7.png
I didn't like how TerrariaPatcher's ItemConfig plugin worked with the large amount of lag and limited options, so I wrote my own. Terraria Item Modifier is a patch that adds simple item customization capabilities to Terraria through configuring an XML file. Modify almost any item variable by editing the ItemModifications.xml file in your Terraria folder. Some variables may require low level knowledge about Terraria. Settings are reloaded every time your player list is loaded.

This patch should work with other patches and modifications. However: Currently this patcher does not support Vanilla v1.4.*.*
There are no checks to see if the game version is supported before patching, so please avoid using it with any version newer than v1.3.5.3.


Use Guide

How to Patch Terraria
How to Edit XML
How to Modify Items
Error Checking
Variable List


vBmaglK.png


Example Uses

~ Play faster notes on instruments with UseTime and UseAnimation ~
~ Allow spawning of any NPC by use of item with SpawnNPCID ~
~ Place any unobtainable wall or tile such as pots by use of item with PlacedTileID and PlacedWallID ~
~ Apply any buff or debuff with BuffID and BuffTime ~
~ Remove the restriction on quest fish not stacking and limiting inventory maneuverability with IsUniqueItem ~
~ Create gag items with fun side effects and descriptions ~
~ Go back in time and give health potions infinite use again with IsHealingPotion ~
~ See full Variable List for endless possibilities ~

T6tWlQB.gif


Requirements

.NET Framework 4.5.2 | Windows 7 or later
Terraria for PC

Downloads: v1.0.3.1

TerrariaItemModifier-1.0.3.1.exe
Supports: Vanilla v1.3.5.3 | Untested: tModLoader v1.3.5.3 | Unsupported: Vanilla v1.4.*.*
(The standalone executable patcher. Dlls in the previous downloads are no longer required)


~ Previous downloads can be found at the bottom of the page ~

vBmaglK.png


Preview
VVWhqLT.png

Wiki | Credits | Image Album | Source Code

vBmaglK.png


⬅ Other Information

v1.0.3.1
  • Now launches Terraria from the configured save folder in Terra Launcher if present on the computer.
  • Fixed incorrect tool name and GitHub page in error message box window.
v1.0.3.0
  • Crafted items now correctly have their defaults set.
  • Item and tooltip renaming is now less hacky and conforms with how
    Terraria handles localization. (You'll still need to restart the game in
    order to remove changes made to names or tooltips)
  • Now tells you if your executable has already been patched.
  • Required files are now copied first so that if an error occurs at that
    point, the executable will still remain untouched.
  • Every required file and dll is now embedded into the executable.
  • Now waits half a second before making the executable large address
    aware. This should fix an issue where it couldn't write to the exe
    because it wasn't closed by the patching library yet.
  • Now asks if you'd like to cleanup required files from the executable
    directory on restore.
  • A bit of code refactoring.
v1.0.2.1
  • Fixed bugs caused when failing to find a path.
  • Added improved Terraria exe locator.
  • Removed background as it made the window look tacky.
v1.0.2.0
  • Added more advanced error logging that should make it much easier to determine the problem.
  • NoSwingAnimation renamed to NoSwingDamage and moved to Combat list.
  • IsDD2Summon moved to Restrictions list.
  • CanChangeDirection renamed to UseTurn.
  • Added Width variable to Visuals list.
  • Added Height variable to Visuals list.
v1.0.1.1
  • Fixed a bug that caused an error while loading players and worlds.
v1.0.1.0
  • Added carriage returns to created example ItemModifications.xml. Now everything should be on its own line, even in dumb text editors.
  • Added Name and Tooltip variables to the created example ItemModifications.xml.
  • Added Launch Terraria option in the File menu.
  • Message boxes now use Windows sounds.
  • NotAmmo variable moved to Details list.
  • IsVanity variable moved to Details list.
  • IsMaterial variable added to Details list.
  • IsWiring variable added to Tools list.
  • IsPotion renamed to IsHealingPotion and moved to Restrictions list.
  • SpawnNPCID now works for any NPC and not just catchable critters. (Singleplayer only)
v1.0.0.0

Comes with all of the essentials needed to patch Terraria and perform item modification. The ItemModifications.xml and required dlls are automatically copied into the Terraria folder upon patching.
 
Last edited:
how do i do the bell one that looked cool

This is the example found in Example Modifications in the wiki. This modifies the use time of all three instruments including the bell. If you only want to modify the bell then take out the other labeled sections.

XML:
<?xml version="1.0" encoding="UTF-8"?>
<ItemModifications>
  <!--Magical Harp-->
  <Item ID="494">
    <ManaUse>0</ManaUse>
    <UseAnimation>3</UseAnimation>
    <UseTime>3</UseTime>
  </Item>

  <!--Harp-->
  <Item ID="508">
    <UseAnimation>3</UseAnimation>
    <UseTime>3</UseTime>
  </Item>

  <!--Bell-->
  <Item ID="507">
    <UseAnimation>3</UseAnimation>
    <UseTime>3</UseTime>
  </Item>
</ItemModifications>
 
I wonder why the MaxStackSize seems to reset in-game whenever I craft more of the object, and try to merge the new creations with a pre-existing stack.

Example. I use the following XML:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ItemModifications>
  <Item ID="8">
  <MaxStackSize>200</MaxStackSize>
  </Item>
</ItemModifications>

ID 8 is a torch. It normally has a max stack size of 99. After running the exe, I can now stack my pre-existing torches beyond the default of 99, up to 200 as intended. I stack to 150 torches.

I craft 3 new torches from wood and gel I possessed. I now combine the 3 new torches with the stack of 150. I get a stack of 153 (so far so good).

Then, I remove 1 torch from the stack of 153, and try to reinsert the single torch back to the same stack of 152 to get back to 153. Result is 99 torches in the inventory stack, and 54 torches held by the cursor that cannot be recombined with the stack. From this point, the stack can only hold the default 99 torches max.

Interestingly, if I create multiple stacks of 99+ first, the other stacks still go to max of 200. Until I add either newly crafted torches to them, or torches from the stack that has already been reset back to 99 max, after which these stacks too seem to reset back to 99 max.
 
I wonder why the MaxStackSize seems to reset in-game whenever I craft more of the object, and try to merge the new creations with a pre-existing stack.

Example. I use the following XML:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ItemModifications>
  <Item ID="8">
  <MaxStackSize>200</MaxStackSize>
  </Item>
</ItemModifications>

ID 8 is a torch. It normally has a max stack size of 99. After running the exe, I can now stack my pre-existing torches beyond the default of 99, up to 200 as intended. I stack to 150 torches.

I craft 3 new torches from wood and gel I possessed. I now combine the 3 new torches with the stack of 150. I get a stack of 153 (so far so good).

Then, I remove 1 torch from the stack of 153, and try to reinsert the single torch back to the same stack of 152 to get back to 153. Result is 99 torches in the inventory stack, and 54 torches held by the cursor that cannot be recombined with the stack. From this point, the stack can only hold the default 99 torches max.

Interestingly, if I create multiple stacks of 99+ first, the other stacks still go to max of 200. Until I add either newly crafted torches to them, or torches from the stack that has already been reset back to 99 max, after which these stacks too seem to reset back to 99 max.

Turns out crafted items are generated before loading players so they were never modified by SetDefaults. I'll write a fix for that right now to reset recipe crafted item defaults.

Edit: New version should be out in an hour. Just doing a bit of code refactoring since I was putting that off until releasing a new version. I'm also fixing up name and tooltip replacing to conform to how localizations work in Terraria.

Edit 2: Fix is live as well as with some other improvements.
 
Last edited:
Does this work With Tmodloader and Modded Weapons?
I'm actually not sure. I haven't really used TModloader outside of debugging Rupee Replacer. If weapons still have referrable IDs then it should work. It also requires that the items are initialized the same way Terraria initializes vanilla items.
 
I'm actually not sure. I haven't really used TModloader outside of debugging Rupee Replacer. If weapons still have referrable IDs then it should work. It also requires that the items are initialized the same way Terraria initializes vanilla items.

most modded weapons item IDs don't go by "numbers" but instead by a "internal name" say for example a Item ID would be called "Golden Sword" or something like that would it be effected the same way as if the item ID was numbers?

<item id="Golden Sword"> VS <item id="24245">
 
Hi, I'm trying to create items similar to the Royal Gel. I want immunity to Hallow Mobs and Crimson Mobs. On two seperate items.
This is what I have now:

---------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<ItemModifications>
<!--Cross Necklace-->
<Item ID="554">
<Name>Hallow Friends</Name>
<Tooltip>'Makes you immune to Hallow mobs'</Tooltip>
<Rarity>Unique in it's kind</Rarity>
<BuffID>170</BuffID><!--Hallow Buff-->
<BuffTime>36000</BuffTime><!--Ten minutes-->
<IsAccessory>True</IsAccessory>
<IsUniqueItem>True</IsUniqueItem>
</Item>

<!--Star Veil-->
<Item ID="862">
<Name>Crimson Friends</Name>
<Tooltip>'Makes you immune to Crismon mobs'</Tooltip>
<Rarity>Unique in it's kind</Rarity>
<BuffID>170</BuffID><!--Crimson Buff-->
<BuffTime>36000</BuffTime><!--Ten minutes-->
<IsAccessory>True</IsAccessory>
<IsUniqueItem>True</IsUniqueItem>
</Item>
</ItemModifications>

---------------------------------------------------------

It's roughly just a copy paste from the exemples that were given, but it kinda works. Exept that the 170 buff icon doesn't show up, ever.
The items have kept their previous mechanisms. They still make me immune and drop flying stars and, at best, I don't want that.
But for now, the most important part is missing. I don't know how to put the immunity buff. What's the code? If anyone can help me I'd be very grateful. Thank you.
 
Hi, I'm trying to create items similar to the Royal Gel. I want immunity to Hallow Mobs and Crimson Mobs. On two seperate items.
This is what I have now:

---------------------------------------------------------

<?xml version="1.0" encoding="UTF-8"?>
<ItemModifications>
<!--Cross Necklace-->
<Item ID="554">
<Name>Hallow Friends</Name>
<Tooltip>'Makes you immune to Hallow mobs'</Tooltip>
<Rarity>Unique in it's kind</Rarity>
<BuffID>170</BuffID><!--Hallow Buff-->
<BuffTime>36000</BuffTime><!--Ten minutes-->
<IsAccessory>True</IsAccessory>
<IsUniqueItem>True</IsUniqueItem>
</Item>

<!--Star Veil-->
<Item ID="862">
<Name>Crimson Friends</Name>
<Tooltip>'Makes you immune to Crismon mobs'</Tooltip>
<Rarity>Unique in it's kind</Rarity>
<BuffID>170</BuffID><!--Crimson Buff-->
<BuffTime>36000</BuffTime><!--Ten minutes-->
<IsAccessory>True</IsAccessory>
<IsUniqueItem>True</IsUniqueItem>
</Item>
</ItemModifications>

---------------------------------------------------------

It's roughly just a copy paste from the exemples that were given, but it kinda works. Exept that the 170 buff icon doesn't show up, ever.
The items have kept their previous mechanisms. They still make me immune and drop flying stars and, at best, I don't want that.
But for now, the most important part is missing. I don't know how to put the immunity buff. What's the code? If anyone can help me I'd be very grateful. Thank you.

Whoa, really sorry for the late reply. First of all Buff ID 170 is the Solar Blaze buff. A lot of buffs are hardcoded to disappear when not wearing the appropriate items so this is why the buff isn't appearing. As for removing the item's old effects, that's unlikely to be possible as it's probably also hardcoded into the item ID and not a setting.

Also note that Rarity is an integer as stated in the Variable List, which means custom text doesn't work. It needs to be a rarity ID.
 
I can't seem to get projectiles working on ranged weapons by changing the ProjectileID.

Sorry for the delay. Have you checked the error log file in the same directory as the xml file? If one exists, it may say what's wrong. The other issue is a lot of the game's mechanics are hardcoded when they have special behavior, so some ranged weapons may not even use their ProjectileID. What weapons are you trying this with?
 
How do you replace item's projectile?

Projectile IDs can be found here

Here's an example of turning Gold Dust into a Coin Portal spawner using projectile IDs. (Note, I have yet actually test this xml since I have yet to fully finish setting up my computer after upgrading to Windows 10). A lot of items may give strange results when settings the projectile ID, this is because they often use multiple projectiles and rely on ProjectileID as the first projectile in the list.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ItemModifications>
  <!-- Gold Dust -->
  <Item ID="1348">
    <Name>Coin Portal Dust</Name>
    <Tooltip>'Place a coin portal'</Tooltip>
    <!-- Set the projectile ID to Coin Portal -->
    <ProjectileID>512</ProjectileID>
    <ProjectileSpeed>10</ProjectileSpeed>
    <!-- Set this so that the item can be used -->
    <UseStyle>1</UseStyle>
    <UseSound>Item1</UseSound>
    <UseAnimation>17</UseAnimation>
    <UseTime>17</UseTime>
    <UseTurn>True</UseTurn>
    <IsConsumable>True</IsConsumable>
  </Item>
</ItemModifications>

Edit: Let me know if that works out, or if you need more help.
 
Last edited:
Projectile IDs can be found here

Here's an example of turning Gold Dust into a Coin Portal spawner using projectile IDs. (Note, I have yet actually test this xml since I have yet to fully finish setting up my computer after upgrading to Windows 10). A lot of items may give strange results when settings the projectile ID, this is because they often use multiple projectiles and rely on ProjectileID as the first projectile in the list.
Code:
<?xml version="1.0" encoding="UTF-8"?>
<ItemModifications>
  <!-- Gold Dust -->
  <Item ID="1348">
    <Name>Coin Portal Dust</Name>
    <Tooltip>'Place a coin portal'</Tooltip>
    <!-- Set the projectile ID to Coin Portal -->
    <ProjectileID>512</ProjectileID>
    <ProjectileSpeed>10</ProjectileSpeed>
    <!-- Set this so that the item can be used -->
    <UseStyle>1</UseStyle>
    <UseSound>Item1</UseSound>
    <UseAnimation>17</UseAnimation>
    <UseTime>17</UseTime>
    <UseTurn>True</UseTurn>
    <IsConsumable>True</IsConsumable>
  </Item>
</ItemModifications>

Edit: Let me know if that works out, or if you need more help.
No that's more than enough. Massive thank you! It works also perfect also
 
This is fantastic! But I want to ask, do u know how to change slimegun's or heart potion's buff?

The slime gun item likely has no influence on what buff is applied, my guess is that the slime gun projectile is the source of the buff. Since this only supports Item modification at the moment, this isn't possible to change. However, an addition of changing projectiles may be nice to add in the future.

Heart Potion (I'm assuming you mean the Love Potion) is the same case, they likely cannot be changed if you've already tried with no effect. Sorry :(
 
I've recently been attempting to utilize both this and Terraria Patcher, yet it appears that the effects of this tool are being overwritten by Terraria Patcher, even when I attempt to patch with this second. My intent is to use it in place of the item config plugin for Terraria Patcher, while retaining the effects of other plugins. Do you have any advice?
 
Last edited:
I've recently been attempting to utilize both this and Terraria Patcher, yet it appears that the effects of this tool are being overwritten by Terraria Patcher, even when I attempt to patch with this second. My intent is to use it in place of the item config plugin for Terraria Patcher, while retaining the effects of other plugins. Do you have any advice?

I'll look into so what's causing the program. Both of my patcher programs are based off of Terraria Patcher so I'm already a little familiar with it. Shouldn't be too hard to figure what's happening. Just to be safe though, can you post your Terraria Patcher configuration settings so I can see what patches are being applied?

Also I'm ashamed I never considered people wanting to use both. It seems so obvious though. :p
 
I'll look into so what's causing the program. Both of my patcher programs are based off of Terraria Patcher so I'm already a little familiar with it. Shouldn't be too hard to figure what's happening. Just to be safe though, can you post your Terraria Patcher configuration settings so I can see what patches are being applied?

Also I'm ashamed I never considered people wanting to use both. It seems so obvious though. :p
[General]
DisplayTime=False
RemoveRodOfDiscordBuff=False
RemovePotionSickness=False
RemoveManaCosts=True
RemoveAnglerQuestLimit=False
RemoveDrowning=False
OneHitKill=False
InfiniteAmmo=True
FixedPrefixes=False
AccessoryPrefix=Warding
PermanentWings=False
InfiniteCloudJumps=False
FunctionalSocialSlots=True
MaxCraftingRange=False
SteamFixEnabled=False
Plugins=True
[Healing]
VampiricKnivesHealingRate=7.5
SpectreHealingRate=20
[Spawning]
SpawnRateVoodoo=15
[PermanentBuffs]
List=115, 172, 26, 117
[ActivePlugins]
ClearExisting=true
InventoryEnhancements=True
Bind=True
BuffImmunity=False
BuffRates=False
ChestSearch=False
CoinGun=False
DropRates=False
EnhancedCellPhone=True
Events=False
Flashlight=False
FullBright=True
GodMode=True
HomingBullets=False
InfiniteFlight=True
InfiniteLifeSteal=False
InfiniteSundial=False
ItemConfig=True
ItemPrefix=True
ItemReplication=True
ItemSpawner=True
LoadoutSwap=False
Minions=False
MoreAccessorySlots=True
NPC=True
PortableCraftingGuide=True
Respawn=False
Reveal=True
SavePosition=False
Season=False
ShopSellsScalingPotions=True
SkipSplash=True
Teleport=True
Time=True
Turrets=False
UseTime=True
Weather=False
While attempting to use both I disabled all of the plugins which I assumed edited item files, such as itemconfig, itemprefix, usetime, etc, yet even then the two tools didn't appear to work. The issue may very well be on my end however, perhaps I missed a plugin which edits items without my realization.
 
Back
Top Bottom