#Coding within a resource pack

75 messages · Page 1 of 1 (latest)

potent edge
#

Hopefully this is the right tag.
But I'm wondering if there is a way to program entites to do something, for example an armor stand that follows an entity. I know you can do it with command blocks, but im wondering how i can code that into my resource pack and not the main game.

sturdy nimbus
#

a resource pack is purely client side and hence cannot edit anything that would affect everybody

potent edge
#

or is command blocks/vanilla modding the only option

sturdy nimbus
#

your options are data packs (or placed command blocks I guess), mods or plugins

potent edge
#

ohh sweet, how would you do data packs?

#

if i ever plan to release my resource pack ill include a data pack with it

sturdy nimbus
#

Well, they are two separate things though
A data pack needs to be installed on the world, a resource pack is a client side thing (well, I guess servers/worlds can enforce a resource pack, but still).

potent edge
#

hmm, so i could have a dedicated server for it that has the data pack, then has the resource pack? would that work?

#

my verdict here is that im trying to have two entities with randomized textures, and one entity has to circle around the other entity. maybe that could spark some solutions

sturdy nimbus
#

"two entities with randomized textures" -> not possible in vanilla (if we are talking about actual entities like a zombie)

potent edge
#

like, two different mobs, sorry. i know how to randomize textures for mobs, but im trying to have one circle around the other

#

hopefully that makes sene

#

sense*

sturdy nimbus
#

like a planet or what?

potent edge
#

thats a much easier way to look at it

sturdy nimbus
#

Well, the complicated part with that would basically be that you need some kind of "ID" score system, so your code knows which entity has to orbit around which entity (instead of all orbiters around one entity).
Then it would just be a matter of rotating the orbiting entity and teleporting it relative to the center entity based on the orbiting entity's rotation

potent edge
#

oh jeez coding is not my strong suit

#

do you know how i could do all that?

#

thanks for all your help btw

sturdy nimbus
#

well, you'd need to know the basics of minecraft commands for me to be able to help you (without me literally coding everything for you basically)

potent edge
#

waittt

#

are command blocks like

#

the same coding language as mc

sturdy nimbus
#

function files in data packs use the ingame commands, yes

potent edge
#

ohhhhHHHHHHHH

#

hmmm

#

finding videos for this specific command is gonna be challenging

#

oh btw @sturdy nimbus while i have you here, is there a way to make entirely new entities instead of replacing existing ones with a resource pack?

sturdy nimbus
#

best you can do is fake one (like all datapacks and plugins do)
as in have a bunch of item models on a bunch of item display entities or similar and teleport/rotate them around to fake animations + maybe a normal invisible entity for behaviour and hitbox (or some custom written "behaviour" with ingame commands)

potent edge
#

ohh ok

#

i actually found out how to make entities spin

#

so ill just do that and add a following function to it

potent edge
#

@sturdy nimbus question for ya

#

/execute at @e[type=cat,limit=1] facing entity @p[distance=1..] feet run teleport @e[type=cat,limit=1] ^ ^ ^0.8

#

i found this command on a youtube video, how can i edit this so that a husk follows a snow golem?

sturdy nimbus
#

replace cat with husk and the @p part with a snowgolem selector

potent edge
#

snowgolem selector?

sturdy nimbus
#

well, just like they select a cat there

#

though that command is pretty badly written, and would behave weirdly with several mobs

potent edge
#

oh

#

thats the best video i found on what im trying to do

#

i just need the folowwing part now as i animated the orbiting itself in blockbench

sturdy nimbus
#

yeah, "entities" in general probably ain't the best thing to start with when one is new with command

potent edge
#

is there an easier way to have entities follow a different entity?

sturdy nimbus
#

I mean, if you animate the orbiting in Blockbench you could probably just have one entity ride the other, no?

potent edge
#

wdym?

#

i cant have the entities in one cause i'd like each of them to be randomized

#

ohh wait i think i get it

#

how would you do that?

sturdy nimbus
#

well, if the orbiting movement is controlled by the animation, it doesn't matter if the husk is 1 block behind the other or riding it, right? (as long as you adjust the animation according to that)

potent edge
#

sorry its 3:25 in the morning for me im kinda slow

potent edge
sturdy nimbus
#

yes, or like a spider jockey

potent edge
#

ohh yeaaaa

sturdy nimbus
#

so /summon snow_golem ~ ~ ~ {Passengers:[{id:"minecraft:husk"}]} for example (though in that command the two would attack each other I guess)

potent edge
#

yep that works completely

#

how can you make them so they dont attack? sorry if im asking too much

sturdy nimbus
#

I'm not actually sure if there is a good way without disabling both their AI completely 🤔 ?

#

(assuming they dod attack each other atm)

potent edge
sturdy nimbus
#

would help, yeah

potent edge
#

okayy

#

@sturdy nimbus do snow golems attack villagers?

sturdy nimbus
#

no

potent edge
#

epic, ill use that

potent edge
sturdy nimbus
#

For you I'd suggest using a command generator like this btw.:
https://mcstacker.net/
And the command would be: /summon snow_golem ~ ~ ~ {Pumpkin:0b,Passengers:[{id:"minecraft:villager"}]}

potent edge
#

@sturdy nimbus btw, thanks so, so much for all your help

#

i wanna find a way to make the Husk work since its an obscure mob that i wont replace with anything

potent edge
#

@sturdy nimbus could you help me find ways to make the snow golem stop trying to shoot the husk? i tried putting them on a team. they dont get damaged, but it still shoots snowballs

#

or how could i stop the snowballs itself

#

nevermind! it was shooting snowballs at the entities i accidentally made invisivl3