Dejans_Prefab_Placer

My first script mod, used to replace a block after placing by a prefab. blocks to be replaced and the related prefab are defined via config file.

with this mod, you can replace a block as soon as you place it with a prefab.

I.e, I created some prefabs in the Palisade mod, along with placeholder blocks. as soon as you place the placeholder block, it will be removed and replaced by the related prefab. Which block should be  replaced by which prefab, is defined in a config file [blocks.properties], which is located in the config folder of the mod and has the following content: 

# Dejans Prefab Placer – Zuordnung Platzhalter-Block -> Prefab
#
# Format:  <Block-ID> = <Prefab-Pfad>|<Drehversatz>|<Y-Versatz>
#
# <Block-ID>     ID des Blocks, den du platzierst (wie im Asset Editor).
# <Prefab-Pfad>  Pfad des Prefabs relativ zum Prefab-Ordner, mit oder ohne
#                .prefab.json. Gesucht wird im Prefab-Ordner der Welt/des
#                Servers und in allen Asset-Packs.
# Drehversatz    Optional 0, 90, 180 oder 270 – falls das Prefab um einen
#                festen Winkel falsch herum steht.
# Y-Versatz      Der Y-Versatz wird in ganzen Blöcken angegeben.
# Positive Werte schieben das Prefab nach oben, negative nach unten.
#
# Nach Änderungen das Spiel bzw. den Server neu starten.
Dejans_Prefabs_Oak_Palisade_Gate = palisade_oak/dejans_palisade_oak_gate.prefab.json|90|-1
Dejans_Prefabs_Oak_Palisade_Segment = palisade_oak/dejans_palisade_oak_segment.prefab.json|90|-1
Dejans_Prefabs_Oak_Palisade_Tower_Corner = palisade_oak/dejans_palisade_oak_tower_corner.prefab.json|0|-1
Dejans_Prefabs_Oak_Palisade_Tower_End = palisade_oak/dejans_palisade_oak_tower_end.prefab.json|90|-1
Dejans_Prefabs_Oak_Palisade_Tower_Straight = palisade_oak/dejans_palisade_oak_tower_straight.prefab.json|90|-1
If there is no config file when the mod is loaded, a sample config is generated, but with no active blocks. 
 
If there are no blocks actively defined in the config file, the mod is inactive and doesn't hook into the block placement event.
 

And as always - any feedback and ideas are welcome.

⚖️Permissions

👍🏻 You are allowed to include this mod in modpacks and use this mod in your videos. A link to the mod page in the description is highly appreciated.

👎🏻 You are not allowed to reupload this mod to any other websites/launchers/apps, use any contents of this mod (models, textures, data, etc) in other projects, put this mod behind any adwalls or paywalls, sell this mod in any way or include in paid modpacks - this mod is free for all players.

Dejans_Prefab_Placer Team

profile avatar
Owner
  • 15
    Followers
  • 11
    Projects
  • 17.6K
    Downloads

More from DejanVHView all