Skip to content

TickBasedEvents ​

com.jsmacrosce.jsmacros.client.tick.TickBasedEvents

Provides client tick bookkeeping and native ItemStack comparison helpers.

js
const Ticks = Java.type('com.jsmacrosce.jsmacros.client.tick.TickBasedEvents');  
const player = Player.getPlayer();  
if (player !== null) {
 Chat.log(Ticks.areNotEqual(player.getMainHand().getRaw(), player.getOffHand().getRaw()));  
}

Constructors ​

new TickBasedEvents ​

new TickBasedEvents()#

Fields ​

serverListPinger ​

static serverListPinger: ServerStatusPingerread-only#
Client server-status pinger used by FClient.ping, FClient.pingAsync, and FClient.cancelAllPings.

Methods ​

areEqualIgnoreDamage ​

static areEqualIgnoreDamage(ItemStack a, ItemStack b): boolean#
Tests whether stacks are both empty or are nonempty stacks with the same item and count whose components pass areTagsEqualIgnoreDamage. That helper compares first-stack entries with raw second-stack values, so this is not a general equality test excluding damage.

Parameters:

  • a: the first non-null stack
  • b: the second non-null stack
Returns: true for two empty stacks, or when both nonempty stacks have the same item and count and pass the component test; false otherwise

areNotEqual ​

static areNotEqual(ItemStack a, ItemStack b): boolean#
Tests whether these stacks differ by emptiness, item identity, count, components, or damage value. Both empty stacks compare as not different.

Parameters:

  • a: the first non-null stack
  • b: the second non-null stack
Returns: true if exactly one stack is empty or the nonempty stacks differ by a listed check; false otherwise

areTagsEqualIgnoreDamage ​

static areTagsEqualIgnoreDamage(ItemStack a, ItemStack b): boolean#
Tests component entries from a against the raw value for each component type in b, ignoring damage. This iterates only a's components; it does not compare item identity or count. Because each entry is compared directly with the raw value from b, this is not a symmetric or full component-value equality test. Both empty stacks pass; exactly one empty stack does not.

Parameters:

  • a: the non-null first stack whose component entries are iterated
  • b: the non-null second stack supplying component values
Returns: true for two empty stacks or when both stacks are nonempty and every non-damage entry from a passes the described comparison; false otherwise