This page relates to Immersive Intelligence, which has built-in support!

The bullet.* package can be used to add and remove bullet cores, components and shrapnel to Immersive Intelligence Bullet System.

Importing the Package

Link to importing-the-package

ZenScript
Copy
import mods.immersiveintelligence.bullet.Bullets; //for addShrapnel, removeShrapnel
import mods.immersiveintelligence.bullet.CoreMaterialBuilder; //for creating bullet cores
import mods.immersiveintelligence.bullet.ComponentMaterialBuilder; //for creating bullet components
TypeNameRequired
Type
String
Name
Name
Required
Yes
Type
int
Name
Color
Required
Yes
Type
String
Name
Texture Path
Required
Yes
Type
int
Name
Damage
Required
Yes
Type
int
Name
Mass
Required
Yes
Type
float
Name
Brightness
Required
Yes

For the Name parameter use a simple material name, such as dirt, iron or diamond.
The Color parameter is a color provided in RGB int format. To get it, pick a color (RGB) in hex and convert the number to decimal.
The Texture parameter is a texture path (resource location) string, f.e. "minecraft:textures/blocks/dirt".
The Damage parameter is a damage value in half-hearts. The Mass parameter determines gravity.

Material NameColorDamageTextureMass
Material Name
aluminum
Color
14281962
Damage
Texture
immersiveengineering:textures/blocks/sheetmetal_aluminum
Mass
0.05
Material Name
zinc
Color
14607324
Damage
Texture
immersiveintelligence:textures/blocks/metal/sheetmetal_zinc
Mass
0.15
Material Name
copper
Color
14908454
Damage
Texture
immersiveengineering:textures/blocks/sheetmetal_copper
Mass
0.25
Material Name
platinum
Color
14213601
Damage
Texture
immersiveintelligence:textures/blocks/metal/sheetmetal_platinum
Mass
0.05
Material Name
gold
Color
13742137
Damage
Texture
minecraft:textures/blocks/gold_block
Mass
0.25
Material Name
nickel
Color
8620151
Damage
Texture
immersiveengineering:textures/blocks/sheetmetal_nickel
Mass
0.25
Material Name
silver
Color
10996424
Damage
Texture
immersiveengineering:textures/blocks/sheetmetal_silver
Mass
0.25
Material Name
electrum
Color
16166233
Damage
Texture
immersiveengineering:textures/blocks/sheetmetal_electrum
Mass
0.25
Material Name
constantan
Color
16348246
Damage
Texture
immersiveengineering:textures/blocks/sheetmetal_constantan
Mass
0.25
Material Name
brass
Color
9795395
Damage
Texture
immersiveintelligence:textures/blocks/metal/sheetmetal_brass
Mass
0.35
Material Name
iron
Color
13092807
Damage
Texture
minecraft:textures/blocks/iron_block
Mass
0.25
Material Name
lead
Color
3817028
Damage
Texture
immersiveengineering:textures/blocks/sheetmetal_lead
Mass
0.75
Material Name
steel
Color
5066061
Damage
Texture
immersiveengineering:textures/blocks/sheetmetal_steel
Mass
0.35
Material Name
tungsten
Color
3882563
Damage
Texture
immersiveintelligence:textures/blocks/metal/sheetmetal_tungsten
Mass
0.45
Material Name
HOPGraphite
Color
2631720
Damage
Texture
immersiveengineering:textures/blocks/stone_decoration_coke
Mass
0.45
Material Name
uranium
Color
6656617
Damage
Texture
immersiveengineering:textures/blocks/sheetmetal_uranium
Mass
0.45

The Brightness parameter is a value 0.0-1.0, determining the glow effect for Albedo (colored lighting mod) compat.

ZenScript
Copy
mods.immersiveintelligence.bullet.Bullets.addShrapnel(String name, int color, String texture, int damage, float mass, float brightness);
ZenScript
Copy
mods.immersiveintelligence.bullet.Bullets.addShrapnel("dirt", 6047289, "minecraft:textures/blocks/dirt", 123, 1, 0);

Removing Shrapnel

Link to removing-shrapnel

TypeNameRequired
Type
String
Name
Name
Required
Yes
ZenScript
Copy
mods.immersiveintelligence.bullet.Bullets.removeShrapnel();
ZenScript
Copy
mods.immersiveintelligence.bullet.Bullets.removeShrapnel("aluminium");

Adding Bullet Cores

Link to adding-bullet-cores

Bullet cores can be creating using a builder class called CoreMaterialBuilder. A new builder can be creating using the CoreMaterialBuilder.create(String name); method. After creation, it needs to be assigned values and finally - registered.

MethodParameter TypeParameter NameDescription
Method
setColor
Parameter Type
int
Parameter Name
Color
Description
Color value in RGB Int format
Method
setDensity
Parameter Type
float
Parameter Name
Color
Description
Value used for calculating mass and gravity of the projectile
Method
setDmgModifier
Parameter Type
float
Parameter Name
Color
Description
Multiplier for the damage dealt by contact with the bullet, default 1.0
Method
setEffectModifier
Parameter Type
float
Parameter Name
Color
Description
Multiplier for the strength/radius of component effect, default 1.0
Method
setPenHardness
Parameter Type
float
Parameter Name
Color
Description
Block Penetration hardness value, see Block Penetration Values
Method
setStack
Parameter Type
IIngredient
Parameter Name
Stack
Description
Ingredient that will be accepted in Projectile Workshop to create the core
Core NameColorDensityDamage ModifierEffect ModifierPenetration HardnessStack
Core Name
core_brass
Color
14329930
Density
0.75
Damage Modifier
0.65
Effect Modifier
1.25
Penetration Hardness
4
Stack
<ore:nuggetBrass>
Core Name
core_lead
Color
3817028
Density
1.5
Damage Modifier
1.1
Effect Modifier
1.0
Penetration Hardness
8
Stack
<ore:nuggetLead>
Core Name
core_steel
Color
6580076
Density
0.5
Damage Modifier
1.25
Effect Modifier
0.65
Penetration Hardness
12
Stack
<ore:nuggetSteel>
Core Name
core_tungsten
Color
3026997
Density
0.35
Damage Modifier
1.45
Effect Modifier
0.25
Penetration Hardness
16
Stack
<ore:nuggetBrass>
Core Name
core_uranium
Color
6656617
Density
0.45
Damage Modifier
1.35
Effect Modifier
0.75
Penetration Hardness
36
Stack
<ore:nuggetUranium>
ZenScript
Copy
var core = mods.immersiveintelligence.bullet.CoreMaterialBuilder.create("dirt");
core.setColor(6047289);
core.setDensity(1.0);
core.setDmgModifier(0);
core.setExplosionModifier(5.0);
core.setPenHardness(0.1);
core.setStack(<minecraft:dirt>);
core.register();

Removing Bullet Cores

Link to removing-bullet-cores

TypeNameRequired
Type
String
Name
Name
Required
Yes
ZenScript
Copy
mods.immersiveintelligence.bullet.Bullets.removeCore();
ZenScript
Copy
mods.immersiveintelligence.bullet.Bullets.removeCore("coreBrass");

Adding Bullet Components

Link to adding-bullet-components

Bullet components can be creating using a builder class called ComponentMaterialBuilder. A new builder can be creating using the ComponentMaterialBuilder.create(String name); method. After creation, it needs to be assigned values and finally - registered using the register() method.

MethodParameter TypeParameter NameDescription
Method
setColor
Parameter Type
int
Parameter Name
Color
Description
Color value in RGB Int format
Method
setDensity
Parameter Type
float
Parameter Name
Color
Description
Value used for calculating mass and gravity of the projectile
Method
setRole
Parameter Type
string
Parameter Name
Role
Description
Value used for creating a generic projectile name, i.e. "armor-piercing - high-explosive", see the list below for valid roles
Method
setStack
Parameter Type
IIngredient
Parameter Name
Stack
Description
Ingredient that will be accepted in Projectile Workshop to create the core
Method
setComponentEffect
Parameter Type
IComponentFunction
Parameter Name
Stack
Description
Function called during the explosion

A list of valid values for the setRole method.

  • general_purpose
  • shrapnel
  • piercing
  • explosive
  • incendiary
  • tracer
  • flare
  • chemical
  • special

IComponentFunction

Link to icomponentfunction

IComponentFunction is a function type, used for creating effects during a bullet's explosion.

TypeNameDescription
Type
IWorld
Name
world
Description
World the explosion happened in
Type
IVector3d
Name
pos
Description
Position vector of the bullet
Type
IVector3d
Name
dir
Description
Direction vector of the bullet
Type
String
Name
coreType
Description
Core type name
Type
float
Name
amount
Description
How much of the component is contained within the projectile (0.0-1.0)
Type
IData
Name
nbt
Description
NBT Data of the component (collected from item)

Automatically generated components (based on fluids, gasses and shrapnel) and are not listed.

Core NameColorDensityRoleStack
Core Name
tnt
Color
14329930
Density
1.0
Role
explosive
Stack
<ore:materialTNT>
Core Name
rdx
Color
13812372
Density
1.25
Role
explosive
Stack
<ore:materialHexogen>
Core Name
hmx
Color
16514043
Density
1.75
Role
explosive
Stack
<ore:materialHMX>
Core Name
nuke
Color
3727570
Density
1.0
Role
special
Stack
<ore:materialNuke>
Core Name
white_phosphorus
Color
13884332
Density
2
Role
incendiary
Stack
<ore:dustWhitePhosphorus>
Core Name
tracer_powder
Color
16777215
Density
0.25
Role
tracer
Stack
<immersiveintelligence:tracer_powder:0>
Core Name
tesla
Color
13283761
Density
1.15
Role
special
Stack
<immersiveengineering:metal_device0:0>
Core Name
propaganda
Color
12234660
Density
0.65
Role
special
Stack
<immersiveintelligence:printed_page:1>
Core Name
flare_powder
Color
16777215
Density
0.25
Role
flare
Stack
<immersiveintelligence:tracer_powder:1>
Core Name
firework
Color
13283761
Density
1.0
Role
flare
Stack
<minecraft:firework_charge>
ZenScript
Copy
import crafttweaker.entity.IEntity;
import crafttweaker.world.IBlockPos;
import crafttweaker.entity.IEntityDefinition;
import crafttweaker.util.Position3f;

var material = mods.immersiveintelligence.bullet.ComponentMaterialBuilder.create("furry_bomb");
material.setColor(6047289);
material.setDensity(1.0);
material.setStack(<minecraft:stone>);
material.setComponentRole("special");
material.setComponentEffect(
    function(world,pos,dir,coreType,amount,nbt) {
            print("*The Furries have Arrived*");
            var pp = (Position3f.create(pos.x as float, pos.y as float, pos.z as float) as IBlockPos);
            var count = (amount*20) as int;

            for i in 0 to count {
                <entity:minecraft:wolf>.spawnEntity(world, pp);
            }
        }
);
material.register();

Removing Bullet Components

Link to removing-bullet-components

TypeNameRequired
Type
String
Name
Name
Required
Yes
ZenScript
Copy
mods.immersiveintelligence.bullet.Bullets.removeComponent();
ZenScript
Copy
mods.immersiveintelligence.bullet.Bullets.removeComponent("white_phosphorus");