your current location:首页 > news>POWERSHOT block physical damage mechanism and configuration file PowerShot Minecraft Game

POWERSHOT block physical damage mechanism and configuration file PowerShot Minecraft Game

2024-12-09 18:31:29|Myriagame |source:minecraft skins

This tutorial is set by the author to use the CC By-NC-SA protocol.

Block physical destruction mechanism

Translate translation from the official wiki of the module

Overview of the mechanism

Logic discharge of ejaculation

Whenever a ejaculation is launched, it calculates a power value and gives it.Note that this power level is different from the original Minecraft power curse level.This is the hidden calculation value inside Powershot.

Then the ejection was flying normally until it hit a physical block.

When it hits a square, it will be checked to determine whether the block can be destroyed and check whether the ejaculation meets the power value required for the block.Then, it either:

If the block cannot be destroyed or not met for damage requirements, stop the ejaculation flying and set its strength value to zero;

Pass through and destroy the square, minus the corresponding value and continue to fly.Whenever it hits more squares, it must be repeatedly checked.

Power value calculation

The initial power value of the ejaculation is calculated in the following ways:

Use a basic value to multiply at the speed of the ejection object, and the unit is the block distance/second

Multiplying the level of any magic on the items that exist on it by the corresponding multiplier by the corresponding multiplication of the corresponding multiplication

Add all these values ​​together.To sum up with a formula:

in:

P is the value value of the initial power

B is the basis value

S is the speed of the ejaculation (square distance/second)

LI is the cursing level of the items (bow, crossbow, etc.) that launch ejaculation

MI is the related multiplication factor of each curse

Basic force values ​​and multiplied factor of each curse can be set by configuration files.Please note that if an ejection material is not emitted with an item (for example, it is emitted from a transmitter), then it will not obtain any additional power values ​​through the curse bonus item.

The following table lists the speed of some ejaculation in the original Minecraft.

Player (bow) 0.3-3.0

Player (crossbow) 3.15

Skeleton 1.6

Predators

1.6

Phantom 2.5

Launch 1.1 Trident player 1.6

Drowning corpse 1.6

Can be destroyed

The two attributes can be given to the damage block, which determines their way of interaction with the ejaculation.

Power value requirements

The minimum power value required for the ejaculation of the ejaculation material

The power value is lower than the required ejaculation that cannot destroy the square block (for example, the ejaculation with a power value of 2.5 cannot destroy the block with the required value of 3.0, and the ejection of the power value of 3.0 can be).

Power value attenuation

The power value of the ejection material when the block is destroyed

Once the ejaculation is destroyed by a block, its power value will be reduced by the attenuation of the power value of the block (for example, a ejaculation with a power value of 2.5It will be reduced to 1.5).

You can specify the attributes that can destroy blocks and their attributes by configuration files.

Configuration file

PowerShot configuration is stored as two JSON files: Power_calculation.json and Breakable_blocks.json.They should be found in the /config/powershot folder directory.

In order to better understand the role of these configurations, it is recommended to complete the working principle of this module first (see the column of the destruction mechanism above).

power_calculation.json

This file defines the value used to calculate the power value of the ejaculation.It should contain a JSON Object object with the following members:

Value name value type description SCHEMA_VersionNumber Configuration file Format version (without moving it) Base_PowerNumber Basic Power Value Enchantment_multipliersobject Mantra

Curse multiplication factor entry

Curse multiplication factor entries must be an object of naming space-curse-diararous-multiplication factor pair (namespaced-enchantment-ID-to-multiplier).

Sample example:

 {{

"Minecraft: Power": 2.0,

"Minecraft: PierCing": 2.0,

"Minecraft: Punch": 1.0,

"Minecraft: Knockback": -1.0}

breakable_blocks.json

This file defines all the attributes that can destroy blocks and them.It should contain a JSON Object object with the following members:

Value name value type description schema_versionNumber configuration file format version (without moving it) Entriesarray

Top -level entry

A top -layer entry must be a JSON Object object, which contains a block entry and/or a tag bar to specify one or a set of cubes that can be destroyed.Here you can also configure the power value requirements and strength attenuation.The following table describes effective member value.

Whether the value type value must exist, describe Blocks

String/Object/Aray If Tags is not specified by the specified block entry, TagsString/Array If Blocks is not specified Power_req

Number None (default value is 1.5) Power value requires Power_rednumberless (default value 1.5) Power value attenuation

Sample example:

 {{

"Blocks": "MineCraft: Glass",

"Tags": "Minecraft: Logs",

"POWER_REQ": 3.0,

"Power_red": 1.5

}

Block

A block entry must specify a block or a set of blocks.It can be a string, a JSON Object object or an array.

As a string

A string block entry must be a single box ID with a name space.The specified block can be destroyed by the ejection object in all states.

Sample example:

 "Minecraft: Torch" 

As the object

An object block must contain a block ID with name space.The object can contain an array of a block state bar, so as to specify which states should be damaged.If the object does not contain the latter, all the states of the block can be destroyed.The following table describes effective object members:

Whether the value type value must exist, describe ID

String must choose a block with name space IDStatesarray.

Sample example:

 {{

"ID": "Minecraft: Glass_pane",

"States": [[

"North = true, south = true",

"North = False, SOUTH = FALSE, EAST = TRUE, WEST = TRUE"

]

}

As an array

A number of blocks in the number of squares must only contain the string block bar and/or the object of the object.

Sample example:

 [

"Minecraft: Cocoa",

"Minecraft: torch",,

{{

"ID": "Minecraft: Glass_pane",

"States": [[

"North = true, south = true",

"North = False, SOUTH = FALSE, EAST = TRUE, WEST = TRUE"

]

}

]

Block status entry

A block state entry must be a string, which contains a string separated by a block state attribute separated by a comma, represents a single block state.Without all attributes of a block state, unspecified attributes will be set to its silent value.For example, if you are creating entries for the square Minecraft: Bamboo, the following example will represent the same block state.

Sample example:

 Age = 1 "
" Age = 1, Leaves = None, State = 0 "

Label

A tag entry must specify one or a set of block marks.It can be a string or an array.

As a string

A string label entry must be a single block tag with name space.All the states of all blocks contained in the tag may be destroyed by the ejaculation.

Sample example:

 "Minecraft: Logs" 

As an array

An array label entry must only include string tag entries.

Sample example:

 [

"Minecraft: Bamboo_plantable_on", "

"Minecraft: LOGS",,

"Minecraft: Enderman_holdable"

]