Skip to content

Instantly share code, notes, and snippets.

@yrsegal
Forked from Vazkii/_makeb.bat
Last active January 10, 2016 23:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yrsegal/f9079807cc29feaf1f25 to your computer and use it in GitHub Desktop.
Save yrsegal/f9079807cc29feaf1f25 to your computer and use it in GitHub Desktop.
1.8 JSON Model/Blockstate autogenerators - ported to sh by WireSegal
#!/bin/sh
# Vazkii's JSON creator for blocks
# Ported to sh by WireSegal
# Put in your /resources/assets/$MODID/models/block
# Makes basic block JSON files as well as the acossiated item and simple blockstate
# Can make multiple blocks at once
#
# Usage:
# makeb (block name 1) (block name 2) (block name x)
# Change this to your mod's ID
MODID="mod"
if [ $# -eq 0 ]
then
echo "Usage:"
echo "makeb [item name] [item name] etc..."
fi
for BLOCK in "$@"
do
echo "Making $BLOCK.json block"
echo "{
\"parent\": \"block/cube_all\",
\"textures\": {
\"all\": \"$MODID:blocks/$BLOCK\"
}
}
" > "$BLOCK.json"
echo "Making $BLOCK.json item"
echo "{
\"parent\": \"$MODID:block/$BLOCK\"
"display": {
"thirdperson": {
"rotation": [ 10, -45, 170 ],
"translation": [ 0, 1.5, -2.75 ],
"scale": [ 0.375, 0.375, 0.375 ]
}
}
}
" > "../item/$BLOCK.json"
echo "Making $BLOCK.json blockstate"
echo "{
\"forge_marker\": 1,
\"defaults\": {
\"model\": \"$MODID:$BLOCK\"
},
\"variants\": {
\"normal\": [{}],
\"inventory\": [{}]
}
}
" > "../../blockstates/$BLOCK.json"
done
#!/bin/sh
# Vazkii's JSON creator for items
# Ported to sh by WireSegal
# Put in your /resources/assets/$MODID/models/item
# Makes basic item JSON files
# Requires a _standard_item.json to be present
# Can make multiple items at once
#
# Usage:
# makei (item name 1) (item name 2) (item name x)
# Change this to your mod's ID
MODID="mod"
if [ $# -eq 0 ]
then
echo "Usage:"
echo "makeb [item name] [item name] etc..."
fi
for ITEM in "$@"
do
echo "Making $ITEM.json"
echo "{
\"parent\": \"$MODID:item/standard_item\",
\"textures\": {
\"layer0\": \"$MODID:items/$ITEM\"
}
}
" > "$ITEM.json"
done
{
"parent": "builtin/generated",
"display": {
"thirdperson": {
"rotation": [ -90, 0, 0 ],
"translation": [ 0, 1, -3 ],
"scale": [ 0.55, 0.55, 0.55 ]
},
"firstperson": {
"rotation": [ 0, -135, 25 ],
"translation": [ 0, 4, 2 ],
"scale": [ 1.7, 1.7, 1.7 ]
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment