Resource icon

Premium Effect Transfer Sword 1.0

This item transfers positve effects from target to player then transfers negative effects from player to target

This code is made with knowledge from studying python and pure laziness and especially i dont want to write the same fucking thing for x amount of times

For anyone who's interested with the python code:
Python:
iteration = 0
effectsList = {"DAMAGE_RESISTANCE":"resistance", "REGENERATION":"regeneration", "SATURATION":"saturation", "INCREASE_DAMAGE":"strength", "FIRE_RESISTANCE":"fire_resistance"}
negative_effets_list = {"BLINDNESS":"blindness", "POISON":"poison", "SLOW_DIGGING":"mining_fatigue", "WEAKNESS":"weakness", "WITHER":"wither", "HUNGER":"hunger"}


with open('sample.txt', 'w') as textfile:
  textfile.write("name: '&eDefault name'\n")
  textfile.write("lore:\n")
  textfile.write("- '&b&oDefault lore'\n")
  textfile.write("material: DIAMOND_SWORD\n")
  textfile.write("activators:\n")
  for effect in effectsList:
    for level in range(4):
      textfile.write("  activator"+str(iteration)+":\n")
      textfile.write("    name: '&eActivator'\n")
      textfile.write("    option: PLAYER_HIT_PLAYER\n")
      textfile.write("    detailedSlots:\n")
      textfile.write("    - -1\n")
      textfile.write("    commands:\n")
      textfile.write("    - minecraft:effect give %player% "+effectsList[effect]+" 10 "+str(level)+" true\n")
      textfile.write("    - minecraft:effect clear %target% "+effectsList[effect]+"\n")
      textfile.write("    targetConditions:\n")
      textfile.write("      ifPlayerHasEffectEquals:\n")
      textfile.write("      - "+effect+":"+str(level)+"\n")
      textfile.write("      ifPlayerHasEffectEqualsMsg: ''\n")
      
      iteration += 1
      
  for effect in negative_effets_list:
    for level in range(4):
      textfile.write("  activator"+str(iteration)+":\n")
      textfile.write("    name: '&eActivator'\n")
      textfile.write("    option: PLAYER_HIT_PLAYER\n")
      textfile.write("    detailedSlots:\n")
      textfile.write("    - -1\n")
      textfile.write("    commands:\n")
      textfile.write("    - minecraft:effect give %target% "+negative_effets_list[effect]+" 10 "+str(level)+" true\n")
      textfile.write("    - minecraft:effect clear %player% "+negative_effets_list[effect]+"\n")
      textfile.write("    playerConditions:\n")
      textfile.write("      ifPlayerHasEffectEquals:\n")
      textfile.write("      - "+effect+":"+str(level)+"\n")
      textfile.write("      ifPlayerHasEffectEqualsMsg: ''\n")
      
      iteration += 1
Author
Special70
Downloads
144
Views
235
First release
Last update
Rating
0.00 star(s) 0 ratings
Top