Achilleus117
Members-
Posts
7 -
Joined
-
Last visited
Achilleus117's Achievements
Tree Puncher (2/8)
0
Reputation
-
Block Damage From Specific DamageSource
Achilleus117 replied to Achilleus117's topic in Modder Support
I actually made my own type of LightningBoltEntity that extends LightningBoltEntity, I guess it may be a bit easier to pass the information to that? -
Block Damage From Specific DamageSource
Achilleus117 replied to Achilleus117's topic in Modder Support
The DamageSource's data says which entity is holding my custom item? Which property is that? The entity that dealt the damage was the lightning bolt. That's not what I need. I need the entity that is holding my custom item. Using the static entity is working, but it stops the player (and only the player) from ever receiving lightning damage even after dropping the item. -
Block Damage From Specific DamageSource
Achilleus117 replied to Achilleus117's topic in Modder Support
The event provides the entity that is being hit, not the entity that is holding my item. Storing the data like that is working, but once the item is dropped it will still block the damage to the player -
Block Damage From Specific DamageSource
Achilleus117 replied to Achilleus117's topic in Modder Support
I set a static LIvingEntity variable on the handler class and set it to the player entity and checked the damage against that, it works but it doesn't seem like the cleanest solution. -
Block Damage From Specific DamageSource
Achilleus117 replied to Achilleus117's topic in Modder Support
My bad, realized I missed that as soon as I posted that. I made a handler and set it to disable damage when the source was lightning. The problem is that it disables the damage for everybody, how can I make it just disable it when my custom item is being held? -
Block Damage From Specific DamageSource
Achilleus117 replied to Achilleus117's topic in Modder Support
Here (https://mcforge.readthedocs.io/en/latest/events/intro/#canceling) it says to call Event#setCanceled to cancel an event, but how do I check it first? Also, where should I be calling it? Every tick? -
I am making a mod that has an item that spawns lightning when used. The lightning is used to attack other entities. I need to block damage from the lightning to just the player. How can I achieve this? I know lightning is one of the DamageSources, is there a way to just block this DamageSource for the user holding the item?