Furnaces and Custom Damage

Discussion in 'Plugin Development' started by orion304, Jan 19, 2013.

Thread Status:
Not open for further replies.
  1. Offline


    To begin, I'm working on some coding for Minecraft: The Last Airbender. I'm a little miffed that I've had to resort to this, as Google and the Javadocs have been excellent resources for everything so far.

    I have two insurmountable problems I'm facing (well, not insurmountable, but I've been unable to have success with them).

    The first of which - I want to turn a furnace on. Those of you who have had some experience with my plugin, I want FireBlast to, upon hitting a regular (non-burning) Furnace, turn it on for 10 seconds (enough to cook 1 item). I see that I can easily cast BlockStates to Furnaces and control cook and burn time there, but upon my tests that resulted in nothing useful (nothing happened). I quickly guess that it was because I have to turn the regular furnace into a Burning Furnace, but it loses its orientation and I'm not even fully convinced it burns objects. I can't simply change the block in BlockState, then force it to update, that doesn't seem to work. I know I'll also probably have to make the inventory persist too. One of the major problems is that the furnace loses its orientation upon any changing. Any ideas?

    The second, far more important issue is that I am trying to deal damage to Entities such that the damage is from DamageCause.CUSTOM, or to alter the damage cause otherwise. It's pretty obnoxious in my opinion that LivingEntities only have two methods for damage (.damage(int) and .damage(int, entity)) and neither of which allows the specification for the DamageCause. This is important to me, as I want to scale the damage done by FIRE_TICK invoked by a Firebender. While I can scale the damage just fine, the damage cause changes from FIRE_TICK to ENTITY_ATTACK, which causes problems with any fire resistance, and ANY anti-cheat plugin. Similarly, all the damage done by any bending is of the cause ENTITY_ATTACK, which is particularly unhelpful for a number of reasons.

    Any ideas, folks?

    If this is particularly helpful, there may be other questions I've just been dying to ask that I've long since forgotten about. We'll see.



    I want to turn a Furnace on with the Bukkit API and nothing more. I also want to deal CUSTOM damage to entities. Any help on either of these?
  2. Offline


    For furnaces why not get the top item and turn it into the smelted version
  3. Offline


    I was doing this to avoid explicitly stating all smeltable items in the code, so that this particular piece of code wouldn't have to be updated anytime they added a smelting feature. And I want the furnace on - which could also be as simple as putting 2 sticks in the furnace if it detects a smeltable item. But again, that would require defining a list of smeltable items.
Thread Status:
Not open for further replies.

Share This Page