#how to place (boss) mobs with custom inventory in worldgen structures [1.20.1]

1 messages · Page 1 of 1 (latest)

dense moth
#

I am trying to replace pillager outposts with a post apocalyptic structure that has pillagers with different guns waiting to shoot at you.
I have a custom summon command that sets their movement speed to 0 (so they stay on the guard towers and shoot instead of jumping down), equips them with all the items and makes them persistent.

I know it is possible to use spawners/mods/etc to make random spawns in structures or to modify the default mob equipment somehow but that doesnt really solve my issue.

I want to place them in a few specific locations (look at example image)
How can i place pillagers with custom inventory at predetermined locations in a structure.
When i save them in the structure their inventory is lost.

dense moth
#

how to place (boss) mobs with custom inventory in worldgen structures [1.20.1]

livid plume
#

you can just save the entities together with the structure by changing the setting in the structure block

#

If you want to randomize the position of the pillagers, you can use a seporate structure that includes the entity and use jigsaw blocks to place that structure

dense moth
livid plume
#

wdym with inventory?

dense moth
#

I know i can use jigsaws, that was my original plan but i dont really need the randomisation

dense moth
livid plume
#

it should be tho

dense moth
#

i have Just Enough Guns installed and want them to guard the structure

livid plume
#

are the guns stored in the nbt data of the pillager?

dense moth
#

its just an item like holding a crossbow

livid plume
#

A different solution I can think of is to include marker entities in your structure and then have a function replace those markers with your pillagers

dense moth
#

summon pillager ~ ~ ~ {Health:30,PersistenceRequired:1b,ActiveEffects:[{Id:11,Duration:999999,Amplifier:1,ShowParticles:0b}],Attributes:[{Name:"generic.movement_speed",Base:-1024f},{Name:"generic.follow_range",Base:100f},{Name:"generic.max_health",Base:30f}],HandItems:[{id:"jeg:semi_auto_rifle",Count:1},{}],HandDropChances:[0.1f,0f],ArmorItems:[{id:"immersiveengineering:armor_steel_boots",Count:1},{id:"immersiveengineering:armor_steel_leggings",Count:1},{id:"immersiveengineering:armor_steel_chestplate",Count:1},{id:"immersiveengineering:armor_steel_helmet",Count:1}],ArmorDropChances:[0.1f,0.1f,0.1f,0.1f]}
summon command example

dense moth
livid plume
#

have you ever worked with functions before?

dense moth
#

yes a bit

livid plume
#

ok perfect

#

Don't worry, it's not that hard:

  1. summon a marker with a tag at the location you want your pillagers to be and give it a tag
    EG: summon marker ~ ~ ~ {Tags:["replace_with_sniper_pillager"]}
  2. Create a ticking function in your namespace and add it to the tick function tag
  3. in that function run another function as all the markers and at their position
    EG: execute as @e[type=maker,tag=replace_with_sniper_pillager] run function <your_namespace>:spawn_sniper_pillager
  4. In that function, put your summon command and kill the current entity (which is the marker)

If you need more help on the individual parts, feel free to ask :)

dense moth
#

ok i will try that thanks
a ticking function is something that always runs in the background ?

livid plume
#

yea

dense moth
# livid plume yea

I cant get it to work
I followed some instructions on how to make a tick function but it doesnt seem to do anything
the summon functions do seem to work and kill the entity that runs them

south topaz
#

you need to add at @s after the selector for your markers. currently the pillagers are being summoned at the world origin

dense moth
#

ah
that explains why there was a bunch of them at spawn lol

#

great now its working

flat solsticeBOT