To store the tornado's contents, you'll want to use DataWatcher to store a boolean for each possible material. DataWatcher doesn't support booleans directly, so you'll either need to store a byte for each boolean (this will be simpler) or pack them into a single byte with bitwise operations (this will take up fewer of the DataWatcher's 32 slots). DataWatcher is synced between the client and server, so you can use these values for both the damage calculations and the rendering.
You can override Entity#attackEntityFrom to react to the Entity being attacked and use DamageSource#getEntity to get the Entity that caused the damage (if any). If the damage was caused by a projectile, this will be the projectile Entity; if it was caused by a direct attack, this will be the attacking Entity.
You can use EntityLivingBase#getHeldItem to get the Entity's held ItemStack. You can call ItemStack#damageItem with the attacking Entity to damage the held ItemStack.
To set the Entity's attack damage, call EntityLivingBase#getAttribute with SharedMonsterAttributes.attackDamage to get its attack damage attribute then use IAttributeInstance#applyModifier to apply a modifier to it. You'll want to create a static AttributeModifier instance with a fixed UUID for each possible material in the tornado and apply them when it gains each material.
You can click the like button on my posts, but it doesn't really do anything.
could you possibly give me an example line of code for each one?
what program should i use to model images since techne is outdated?
I'm not too sure which model program to use. Forge seems to have replaced its OBJ model loader with a Blitz3D model loader, but I don't think you can easily use it for entities.
Rollback Post to RevisionRollBack
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
To store the tornado's contents, you'll want to use DataWatcher to store a boolean for each possible material. DataWatcher doesn't support booleans directly, so you'll either need to store a byte for each boolean (this will be simpler) or pack them into a single byte with bitwise operations (this will take up fewer of the DataWatcher's 32 slots). DataWatcher is synced between the client and server, so you can use these values for both the damage calculations and the rendering.
You can override Entity#attackEntityFrom to react to the Entity being attacked and use DamageSource#getEntity to get the Entity that caused the damage (if any). If the damage was caused by a projectile, this will be the projectile Entity; if it was caused by a direct attack, this will be the attacking Entity.
You can use EntityLivingBase#getHeldItem to get the Entity's held ItemStack. You can call ItemStack#damageItem with the attacking Entity to damage the held ItemStack.
To set the Entity's attack damage, call EntityLivingBase#getAttribute with SharedMonsterAttributes.attackDamage to get its attack damage attribute then use IAttributeInstance#applyModifier to apply a modifier to it. You'll want to create a static AttributeModifier instance with a fixed UUID for each possible material in the tornado and apply them when it gains each material.
You can click the like button on my posts, but it doesn't really do anything.
I am having a boat load of trouble with this, can you please walk me through it?
could you possibly give me an example line of code for each one?
what program should i use to model images since techne is outdated?
what model program should i use since techne is outdated?
I'm not too sure which model program to use. Forge seems to have replaced its OBJ model loader with a Blitz3D model loader, but I don't think you can easily use it for entities.
Chisel Facades: For all your decorative pipe-hiding needs.
Please don't PM me to ask for help or to join your mod development team. Asking your question in a public thread preserves it for people who are having the same problem in the future. I'm not interested in developing mods with people.
I am having a boat load of trouble with this, can you please walk me through it?