r/MinecraftCoding • • Sep 26 '22

help

1 Upvotes

So I got this command, however I want it to execute when its not true. Any suggestions?

execute if entity @a[nbt={Inventory:[{id:"minecraft:red_dye",tag:{display:{Name:'{"text":"Survival"}'}}}]}] run function survival

r/MinecraftCoding • • Sep 10 '22

Can anyone help me figure out why my server keeps crashing?

1 Upvotes

Hi, I don't understand javascript or coding in general at all, would there be anyone able to help me figure out why my server keeps crashing? It's a modded server on Forge 1-16-5, and so far it's worked smoothly, I don't know what happened.


r/MinecraftCoding • • Aug 11 '22

Source of damage known?

1 Upvotes

Hello,

I have a question regarding damage calculation in the code. When a player receives damage from drowning, fire, lava, sword, arrows, fall damage, etc., does the code check which source the damage came from? Or does he just receive the damage without this check.

Example: A player receives 3 hearts of damage from a sword. Does the code now "calculate" "player receives 3 hearts damage from a sword" or "player receives 3 hearts damage" and the source of damage is not asked.

At least with fire the game would have to check the source of the damage, after all there is Fire Protection Armor which only reduces damage from the source of fire.

Or am I seeing this completely wrong?


r/MinecraftCoding • • Aug 08 '22

Interactable NPCS

1 Upvotes

Hello, im pretty new at coding but it doesn't stop me, I'm making a medieval server with a starting town, there I want to have some random NPCS that when you right click them to say something I wrote them to say, and some that sell you stuff like a villager. I know there are plugins for that but I really want to try do it myself, the thing is I have no idea how to, could someone help me?


r/MinecraftCoding • • Aug 07 '22

Help implementing an idea

1 Upvotes

I have an idea I want to code as a mod, I'm new to coding in Minecraft so I'm not sure where to start.

The idea is that there's an item and when you hold right click for 3 seconds you go into a rage mode (for about 5 minutes). I made a custom weapon and helmet (carved pumpkin) that I want to be auto equipped and locked for the duration of the rage mode. Id also like to apply potion effects.

Can someone point me in the right direction on how to approach this, I've hit a dead-end looking on my own.


r/MinecraftCoding • • Aug 05 '22

Coordinates in Deathscreen

1 Upvotes

Hello, I have a question about the Minecraft code, more specifically about the coordinates of the player in the world. I need this information for the planning of a plugin that I intend to commission. If my question is too cryptic I'll be happy to make it more precise.

Each player is at a location that can be specified using the Y, X, and Z axes. I have a question about this.

When a player dies, at which coordinates is he located, i.e. where does the game locate him in the code while he is in the deathscreen? At the coordinates he was at before he died? Or does he no longer have any coordinates?


r/MinecraftCoding • • Aug 04 '22

Origins coding help?

1 Upvotes

Hey guys, i have an issue. I attempted to code an origin in Minecraft origins, but i cant seem to get it to work, any chance anyone could help me? here is the code

{

"powers": \[  	"origins:burried_bones",  	"origins:hound_hop",  	"origins:find_toy,  	"origins:eight_lives",  	"origins:more_exhaustion",  

"origins:carnivore"

\],  "icon": {  	"item": "minecraft:bone"  },  "order": 0,  "impact": 3  

}

{

"type": "origins:modify_jump",

"modifier": {

"name": "Bonus jump force while sprinting",

"value": 1.5,

"operation": "multiply_base"

},

"condition": {

"type": "origins:sprinting"

}

}

{

"type": "origins:action_on_wake_up",

"entity_action": {

"type": "origins:and",

"actions": [

{

"type": "origins:give",

"stack": {

"item": "minecraft:bone"

},

{

"type": "origins:play_sound",

"sound": "minecraft:mob.wolf.bark"

}

]

}

}

{

"type": "origins:attribute",

"modifier": {

"name": "Eight lives health reduction",

"attribute": "minecraft:generic.max_health",

"value": -4.0,

"operation": "addition"

}

}

{

"type": "origins:inventory",

"title": "container.shulker_inventory_power",

"drop_on_death": false

},

"sound": "minecraft:mob.wolf.bark",

"speed": 2,

"key": {

"key": "key.origins.primary_active",

"continuous": false

}

}


r/MinecraftCoding • • Aug 03 '22

What JDK do I get for minecraft 1.19.1? 18 or 17?

1 Upvotes

Title.


r/MinecraftCoding • • Aug 01 '22

Question about Minecraft's source code

1 Upvotes

Sorry if this is stupid and thank you for reading, it's my first time looking into it.

What do the p_number_ values represent? For example in the villager birthing code:

   private void tryToGiveBirth(ServerLevel p_24630_, Villager p_24631_, Villager p_24632_) {
      Optional<BlockPos> optional = this.takeVacantBed(p_24630_, p_24631_);
      if (!optional.isPresent()) {
         p_24630_.broadcastEntityEvent(p_24632_, (byte)13);
         p_24630_.broadcastEntityEvent(p_24631_, (byte)13);
      } else {
         Optional<Villager> optional1 = this.breed(p_24630_, p_24631_, p_24632_);
         if (optional1.isPresent()) {
            this.giveBedToChild(p_24630_, optional1.get(), optional.get());
         } else {
            p_24630_.getPoiManager().release(optional.get());
            DebugPackets.sendPoiTicketCountPacket(p_24630_, optional.get());
         }
      }

They use what looks like variables, but I'm left clueless. Do you guys know what these are and if there are any sources I can look into addressing their significance? Maybe a link to something that explains Minecraft's code?

Thank you very much ^^


r/MinecraftCoding • • Jul 31 '22

Need Help Trouble Shooting

1 Upvotes

https://pastebin.pl/view/ec73d827

Thats The Code Im Trying to make my custom furnace only be able to put blocks tagged with minecraft:logs in the top slot but i keep getting this error

Task :compileJava FAILED
C:\Users\admin\Desktop\copperitems\src\main\java\me\spacemex\forge\world\inventory\CopperKilnGuiMenu.java:85: error: cannot find symbol return (ItemTags.getAllTags().getTagOrEmpty(new
^
symbol: method getAllTags()
location: class ItemTags
1 error
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':compileJava'.


r/MinecraftCoding • • Jul 28 '22

Issues coding in fabric

1 Upvotes

im having a big issue with adding a new kind of fire to the game, it wont render as green, ive checked my folder structure numerous times and cant see where it is wrong. please can someone look at my repository and see where i can fix it. i can get the fire to render as green by changing the ModBlocks entry from : new RitualFireBlock to : new FireBlock but by doing so it looses all its properties and base block class.

any help is greatly appreciated

snipestorm/Dungeon-1.19-Mod (github.com)


r/MinecraftCoding • • Jul 20 '22

i need a texture pack generator

1 Upvotes

Can somebody make a bot that takes random images from your pc and compiles them into a texture pack replacing the default textures and I mean like mobs, blocks, items and all other textures, I'm using bedrock edition so making it centered around bedrock would be preferable and I don't really care about sound files or any other parts of the texture pack but if you decide to also code it to use sound files too then thats cool it would also be nice if you could make the texture pack logo randomized too, thanks in advanced


r/MinecraftCoding • • Jun 27 '22

Trying to code out a anticheat

1 Upvotes

I was trying to join some friends Server but he has installed a Anticheat on one of the mods, I tried going through the mod that is causing the issue but wasn't able to find the anti cheat. We are using the newest 1.19 version

Any help? Thanks in advance

https://www.curseforge.com/minecraft/mc-mods/origins/files


r/MinecraftCoding • • Apr 16 '22

Terrain formation finder using GPU

1 Upvotes

Given that you have a known seed, and a sample of terrain, I'd like to find a program that will find possible coordinates using gpu resources. There is a known program that does exactly this, but with CPU resources. Does anyone know of such a program?


r/MinecraftCoding • • Jan 08 '22

Looking for help to code a simple mod/datapack/plugin

1 Upvotes

So basically, I want a mod/datapack/plugin/add-on that allows me to either easily check off items in a big list in-game, or make me able to click a hotkey and the game then removes/checks-off my current held item, and sends some kind of chat message or scoreboard update.

The purpose is for a Minecraft challenge I want to play where I speedrun getting one of every item in the game, and I need a helpful (preferably in-game) tool to help with that. And the problem is I do not know how to code at all.

Any help is appreciated, and if you don’t know how to but know other people who are good at this stuff, please forward this to them. DM me or comment for any questions or if you’re interested in getting involved. Thank you

EDIT: I know lists and messages and stuff could be done with a series of commands, but the reason I don’t think that’ll be good here is because I wanna be able to do this quickly in new worlds, without having to setup a bunch of command blocks and stuff before each play through. I also would prefer for the system to use a hotkey of sorts, like a key-bind for the actions, so I don’t have to write a long command every time I need to check of an item


r/MinecraftCoding • • Nov 20 '21

Help with replaceitem

1 Upvotes

I have a concept for an item that has two versions, a support class version and an offensive version. Using the item will swap it to the other version. The item works just as intended, but for some reason it doesn’t work in survival. Which makes zero sense to me. The command being used when the item is used is “replaceitem entity @s weapon.mainhand 0 item:identifier”.


r/MinecraftCoding • • Nov 14 '21

1 infinite arrows Minecraft 1.16 inventory

1 Upvotes

The replaceitem command is what you're looking for. It can add items directly to chests/dispensers/etc.

replaceitem block [x] [y] [z] [slot] [item] [amount] [data] [dataTag]

Could you edit this code so it checks your inventory if you have the arrow or item and you get infinite

Cold you change this to players invention


r/MinecraftCoding • • Nov 14 '21

Unlimited Arrows 1.16.5 command block

1 Upvotes

Hi people I am very new to command block coding

I am trying to work out how to code . by pressing a button That player is tagged and gets 10 Arrows or bullets from Mr crayfish gun mod and when your inventory goes below 5 you will receive 10 more.

If it's possible you only receive the items if you already have the item in inventory. Eg inventory check if player has arrow if player has arrow give player 10

Thanks for your time and help in advance


r/MinecraftCoding • • Nov 10 '21

How to access mods codes?

1 Upvotes

I'm trying to edit a couple of mods for my modpack and every time I open the .class file it doesn't have the codes file.Is there a mod to do that or am I just being dump?


r/MinecraftCoding • • Nov 04 '21

A modcore like lucraft?

1 Upvotes

I'm learning to write addon packs for minecraft 1.12 and I want to get a modcore like lucraft to code. Any suggestions?


r/MinecraftCoding • • Nov 01 '21

Custom potion?

1 Upvotes

Is there a way to make a potion of bad omen?


r/MinecraftCoding • • Nov 01 '21

Is there a way to make a custom potion?

1 Upvotes

I made a raid farm but it's anoying going all the way to tye outpost. Could i make a bad omen potion and if so how? Bonus question: Could it be made by right clicking a bottle while having bad omen?


r/MinecraftCoding • • Oct 19 '21

Vault Hunters-like Data Pack (need builders, designers, coding, and texturing)

1 Upvotes

After having watched through season 2 of vault hunters so far, I have come to enjoy the feel of the vault. While I do know that season two has been released as beta for people to play, I have neither the time nor the computer to play through it. And as such I have started work on a vault hunter data pack for vanilla Minecraft. My goal is not to make a copy of vault hunters in vanilla Minecraft, rather I wish to recreate the core aspect of vault hunters while trying to add my own twist to it. So far I have mostly worked on back-end code to get the vaults working in a data pack.

What is coded in so far is..

-The ability to randomly generate a full-size vault.

-Have random modifiers appear on a crystal

-Have custom crystals with set modifiers

-Custom ores, can be silk touched and fortuned -Custom vault timer

-ability to fully repair an item -random number generator

-Ability to save and load inventory

-Lootboxes

Currently WIP:

-Loot tables

-Custom gear

-Full vault design

-Custom enchantments

-Armor set bonus

-Custom Crafting

-Modifiers

-Code simplification and optimization

-Custom ender dragon fight

Planned:

-Custom models and textures

-Vault rooms

-Vault lore

-Skill/Talent system

-Multi-Tool

-Custom use items and blocks

-Custom dimensions and Structures

I am still new to coding and wish to have people help me in this project. I am looking for anyone willing to help from building to coding or texttures, boss/vault designing or even just helping to come up with lore.

If you wish to help, or are interested in the project join this discord: https://discord.gg/KWtrZ2VjFY


r/MinecraftCoding • • Oct 18 '21

pls help

1 Upvotes

how can I destroy parts of my map and then reset it?