mithicalminecraft

Incremental Hit Counter Explanation

Apr 5th, 2015
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. Incremental Hit Counter - for those who can't understand the video because of my garbage voice right now.
  2.  
  3. So, What's This Thing Do?
  4. This is designed to count the number of times a player has been hit by a specific enemy within a certain amount of time, at its core. This specific implementation of it applies a potion effect each time the player is hit (first hit is Nausea, second is Weakness II, third is Blindness), up to three hits. Upon the fourth hit, it kills the player. This design is infinitely expandable by simply adding additional scoreboard trackers and repeating the design over.
  5.  
  6. How's It Work?
  7. It uses a pair of scoreboard stats -- damageTaken, which is directly tracking stat.damageTaken, and hit1/hit2/hit3/hit4 (it only uses one at a time). damageTaken is incremented any time a player takes damage, and hit1 is incremented whenever damageTaken is above 0 and the player is within a 2 block radius of the specific enemy. In this instance, it is working with Endermites who have the name of 'Rat'. With each trigger, an AND gate is tested to give double-verification that the player DID take damage and that it WAS from the specific named enemy.
  8.  
  9. What's This Good For?
  10. I designed it for an area in my upcoming CTM, Ethereum Caverns, where it will be the core element behind a boss fight.
Advertisement
Add Comment
Please, Sign In to add comment