Started by
vOlive
on
Topic category: Help with Minecraft modding (Java Edition)
I am making a large combat mod! I am adding a few really cool weapons to the game but I want to make it so the same weapon can only be crafted once. I would be happy to make it so users would have to interact with a structure or something like that. But anything that avoids the crafting table and makes it so the weapons are one-time crafts.
This is just really bugging me and I don't know what to do
You're saying this is a large combat mod, so I am going to assume that you want to create multiple one-time craft items. You could create a block that the player has to craft to get the ability to craft these items. You could make so the player has to craft a sort of base for each item using the correct materials in the crafting table, and then activate the base with the block so the item becomes usable (activating as in right clicking on the block with the item on hand). Then, depending on whether you want it to be craftable once per player or world, you'd either use a player attribute that increases when they craft it and the block checks it is below a certain value (this way you can also create a gamerule that lets the player change the amount of that item they can craft) or create a global variable that is either a boolean or an int and make sure it is the correct value before giving the player the activated item. Hope this helps :)
Would this work server-wide? Like for a server.
I think the global variable method would work server-wide, so long as you use the default scope of 'map'
Would this work server-wide? So the item would be crafted and no player on the whole server could ever craft it again.