There are 3 main ways you can ban an item
1. Ban a specific item
You can write an item code in string format, such as "flaxtwine" like this:
"BannedItemCodes": [
"flaxtwine"
],
You can search for item codes in this wiki: https://wiki.vintagestory.at/Special:MyLanguage/Item_codes
Or you can turn on Developer Mode and see the item codes in-game: Settings -> Interfaces -> Developer Mode
2. Ban a group of items using wildcard
Notice that in the vanilla version, item codes (like above) are written with an organized prefix (or suffix). For example :
- fish-raw
- fish-cooked
- fish-cured
Therefore, you can use wildcards to ban anything starting with fish:
"BannedItemWildcards": [
"fish-*",
],
ending with fish:
"BannedItemWildcards": [
"*fish",
],
or has a "fish" string somewhere in the middle of the item codes:
"BannedItemWildcards": [
"*fish*",
],
The last example above, "*fish*", should normally be avoided, because you are banning everything that has the word "fish" but might not be related, e.g., "fish-trap", "clothing-fisherman", "fishscale".
3. Lastly, you can ban a certain class of the items
I imagine that not ALL modders follow the convention of item code naming as in vanilla, so if you have a bunch of mods installed and are not sure about the item codes of those installed mods, you have a last powerful option, which is banning the class of items. All items in Vintage Story are inherited from a certain class of code. For example, a poultice has its code written like this:
public class ItemPoultice : Item, ICanHealCreature
Let's say a modder makes a mod that increases the healing effect of poultice or adds many other different types of poultice, chances are they will use "ItemPoultice" class or "ICanHealCreature" class. Therefore, you can ban all poultices using:
"BannedClassTypes": [
"Vintagestory.GameContent.ItemPoultice"
],
Or if you want to go a step further, ban all healing items:
"BannedClassTypes": [
"Vintagestory.GameContent.ICanHealCreature"
],
Or you require players to be completely naked to teleport:
"BannedClassTypes": [
"Vintagestory.GameContent.Item"
],
The prefix "I" in "ICanHealCreature" stands for "Interface", btw, some have this prefix, some do not. Here is where you find out the "code" classes of items: https://github.com/anegostudios. You just need to anticipate which item class the modder uses, or check their code, if it's available on GitHub.
Further explanation on banning using class
Let's work with an example of a "poultice". Upon landing on the Github page of Vintage Story (at https://github.com/anegostudios), use the top right search bar in GitHub, and type in "poultice". You should see only 1 result. In case of multiple results, select the one with the tag "class" in front of it. Then you should see a code file like this:
using System;
using System.Text;
using Vintagestory.API.Client;
using Vintagestory.API.Common;
using Vintagestory.API.Common.Entities;
using Vintagestory.API.Config;
using Vintagestory.API.Datastructures;
using Vintagestory.API.Util;
#nullable disable
namespace Vintagestory.GameContent
{
public class ItemPoultice : Item, ICanHealCreature
{
public override void OnHeldInteractStart(ItemSlot slot, EntityAgent byEntity, BlockSelection blockSel, EntitySelection entitySel, bool firstEvent, ref EnumHandHandling handling)
{
...
What you should look for is the namespace line, in this case, "namespace Vintagestory.GameContent", remember this "Vintagestory.GameContent", you need to specify the namespace in the config as well. Next, you should see the class signature "public class ItemPoultice : Item, ICanHealCreature". This simply means the ItemPoultice is derived from the class "Item", and "ICanHealCreature". If a mod adds multiple new types of poultice, they likely inherit this "ItemPoultice" class. Also, they might have renamed it to something like "ItemPoulticeAdvanced". So the chain of inheritance would look like this: "ItemPoulticeAdvanced → ItemPoultice → ICanHealCreature". The problem is you might not know what the modder named their class (if their code is not on Github), or you might want to ban all kinds of Poultice, so instead of writing:
"BannedClassTypes": [
"Vintagestory.GameContent.ItemPoulticeAdvanced"
],
You can simply write:
"BannedClassTypes": [
"Vintagestory.GameContent.ItemPoultice"
],
Note that by banning "Vintagestory.GameContent.ItemPoultice", you ban the "ItemPoultice" itself and any items that are the offspring of this class (child, grandchild, great-grandchild, etc.). So if you now install another mod extension that has a class called ItemPoulticeAdvanced2, which is a child of ItemPoulticeAdvanced, this would also be banned (without you changing the config). The inheritance tree looks like this: "ItemPoulticeAdvanced2 → ItemPoulticeAdvanced → ItemPoultice → ICanHealCreature".
Now let's get back to the namespace issue, you need to make sure that you use the correct namespace, sometimes, it could be "Vintagestory.API.Common." instead of "Vintagestory.GameContent." so you need to go to the Github page of VintageStory to confirm that.
GreenSage Thanks for your hard work, I'll give it a look!
Ramaya Done! Have fun, if you run into any bugs feel free to let me know.
GreenSage Thanks a lot for the awesome mod! Could you please add the recipe to the config in the next update? That would be super helpful 🙏
@Rhapsody: Yeah, TP is quite gameplay-breaking (only my personal opinion), so this was meant to be creative only.
Having said that, I can add a recipe for you since it's not complicated to do so. But it'll be off by default, you'll need to check out the config to turn it on in the next mod update.
Hi Sage, first, I love the texture on the teleporter, it's a cool look.
I installed it and had a look (I've wanted to craft creative teleporters so bad I'm slowly getting into modding), but I'm misunderstaning something. Is there a way to craft it? It looks like a creative only block.
WickedSchnitzel Oops, I forgot to set that for servers, thanks for letting me know!
It does not seem to generate a mod config json on servers.
Guimoute: Thank you! 😀
Lovely art!