your current location:首页 > news>CUSTOM MACHINRY -Machine Appearance [CM] Custom Machinery Minecraft Game

CUSTOM MACHINRY -Machine Appearance [CM] Custom Machinery Minecraft Game

2024-12-10 17:49:02|Myriagame |source:minecraft skins

This article tells how to make the appearance of the machine. The content comes from the official wiki and is only translated.

The appearance of the machine will define the basic information of this machine's model, texture, and sound.

The machine naturally has different states. We can make different appearances for different states of the machine, respectively::

idle (idle), running (operation), errored (error), paused.

The following is an example:

 "APPEARANCE": {

"Property1": "DEFAULTVALUE",

"Property2": 1,

"IDLE": {{

"Property1": "Value",

"Property2": 42

},

"Running": {

"Property1": "SOME_VALUE",

"Property2": 23

},

"Errored": {

"Property1": "Another_value",

"Property2": 666

},

"Paused": {

"Property1": "Again_another_value",

"Property2": 56487

}

}

If you do not have a custom appearance, then this machine will enable the default appearance mode.

If you customize the appearance, then the custom attribute will cover the default attribute, otherwise the same.

All the appearance options have the default value.

property

There are currently 10 optional attributes in the appearance of the machine:

Block appearance: block

There are two ways to use the appearance of the block: the available blocks in the current game, or the box created by the customized appearance.

Ready -made squares:

This attribute can directly use the namespace: block_id [state1 = value, state2 = value ...] to use the square state.

The BlockStates state is optional. You can directly use namespace: block_id to obtain the default state.

example:

 "APPEARANCE": {"block": "Minecraft: Furnace [LIT = TRUE]" "

}

Then this machine will show the appearance of the original melting furnace.

Customized model:

If you don't want to use the ready -made blocks in the game, you need to use the block attribute to point to your model position.

The model must be the JSON model of MINECRAFT, and you have used a resource package to load this model.

This model must be located in the position of Assets/namespace/models/machine or below, otherwise it will not work.

example:

Suppose you have a model located in Assets/namespace/Models/Machine/My_machine.json, then the definition of the block attribute should be namespace: Machine/My_machine.

Then the code is:

 "APPEARANCE": {

"Block": "Custommachinery: Machine/My_model"

}

Please do not draw a snake to add. Json behind the code, the block attribute will make up for your suffix name.

You need to restart the game to display using a custom model.

Item appearance: ITEM

By default, the appearance of the machine's items will be consistent with the appearance of the block, but you can use this attribute to customize the machine in your hand.

Like the Block attribute, the ITEM attribute can also use ready -made items, or a custom model.

Ready -made items:

 // When the machine is holding it in hand, it will be displayed as a diamond

"APPEARANCE": {

"Item": "Minecraft: Diamond"

}

Note: If this item contains animation effects: such as bow, compass, clock, etc., it may cause some rendering problems. If you use more complicated models, such as tridents, boxes, armor frames, etc., this will not work.

Customized model:

The same as the Block attribute, Item's model position must also be under the asset/namespace/models/machine folder.

example:

Suppose you have a model located in Asset/namespace/models/machine/my_machine.json, then the definition of the item attribute should be namespace: Machine/My_machine.

Then the code is:

 "APPEARANCE": {

"Item": "Custommachinery: Machines/My_model"

}

Similarly, you need to restart the game to see the application of custom models.

Sound: sound

The sound is completely different from the items and squares. The sound is to be registered in the game to use it. Therefore, you need to use some MOD or resource package to customize the unique sound, and the file suffix of the sound must be .OGG.

Therefore, you can only use the source of sound in the game by default.

 // The method of custom machine sound

"APPEARANCE": {

"Sound": "namespace: sound_location"

}

If you do not use this attribute, the machine will not make a sound.

Spontaneous light brightness: light

The machine supports self -luminous light. If you want to light up this machine, then you must use this attribute.

This attribute supports the original light brightness, that is, level 0-15 and an integer.(For example, the torch is 14, and the red stone fire handle is 7).

 // The method of custom machine sound

"APPEARANCE": {

"LightLevel": 15

}

If you do not use this attribute, the machine will not shine.

The machine calls its own color: color

Hardness Index: Hardness

The excavation hardness of this block is default to 3.5 and supports floating points.

Explosion -proof index: Resistance

The explosion resistance index of this block, defaults to 3.5, supports floating -point numbers.

Destroy the tool type required for the machine: TOOL_TYPE

This machine needs to be destroyed by the tools corresponding to the application, otherwise it will slow down the damage and will not drop the machine itself, but it will fall out of the items stored inside the machine.

The default: pickaxe (pick), you can also use: shovel (锹), axe (ax), hoe (hoe), sword (sword), hand (karate)

Several levels of tools are required to destroy the machine: mining_level

Need a positive integer definition, default: 1 (stone tool), you can also use: 0 (wood/gold tool), 2 (iron tool), 3 (diamond tool), 4 (lower alloy tool).

Collting box: shape

Generally speaking, the collision volume of the machine is a whole block.

You can customize the collision volume of this block, but not greater than one block.

The collision volume of the machine will not change with the rotation of the machine, so if this square block has been rotated, the collision volume may cause problems.

You can use a ready -made block collision volume, such as half bricks, stairs, etc. You can also use a custom collision box.

Ready -made collision box:

 "APPEARANCE": {

"Shape": "Minecraft: Repeater [Property1 = Value1, Property2 = Value2]"

}

[] Can be omitted, so the collision volume of the machine using this example will be as large as the redstone relay.

Note: If other mods are registered with ordinary tool registration methods, then the special tools are registered, then the Tool_Type and MinIn_level attributes can be expanded into other tools.

Custom collision box:

You can customize a collision box. The writing of this collision box is: [minx, miny, minz, maxx, maxy, maxz].

All box values ​​must be between 0.0 and 1.0, and the complete collision box is [1, 1, 1, 1, 1, 1, 1].

 // half brick

"APPEARANCE": {

"Shape": [[0.0, 0.0, 0.0, 1.0, 0.5, 1.0]]]]]

}

Default machine appearance

If the above attributes are not customized, then that attribute will use the default value:

 "APPEARANCE": {

"Block": "Custommachinery: Block/Custom_machine_block",, "

"Item": "Custommachinery: Block/CUSTOM_MACHINE_BLOCK",

"Sound": "",,,,

"LightLevel": 0, "color": 16777215,

"Hardness": 3.5,,,

"Resistance": 3.5,

"Tool": "Pickaxe",

"MiningLevel": 1,

"Shape": [[0, 0, 0, 0, 1, 1, 1]]]

}

Exemplary example

Example 1:

 "APPEARANCE": {

"Block": "Minecraft: TNT",

"Sound": "Minecraft: block.anvil.place",, "

"LightLevel": 10

}

The machine using this example will be the appearance of TNT, and the sound of an avil will be emitted at runtime, and level 10 of the light is emitted.

Example 2:

 "APPEARANCE": {

"Block": "Minecraft: Furnace",

"Running": {

"Block": "Minecraft: Furnace [LIT = TRUE]", ",", ",", ",", ",", ",", ",", ","

"Lightmode": 15

}

}

The machine using this example will be the appearance of the furnace when it is idle, and if the machine is running, it will change its appearance when the appearance of the furnace is fired.