Skip to content

Latest commit

 

History

History
364 lines (258 loc) · 8 KB

docs_api.md

File metadata and controls

364 lines (258 loc) · 8 KB

HardSurvivalStrategie API

To understand more about the datapack, for future development.

Notation

Before continuing, it is considerable that the developers know how data is treated here.
It is known that dummy objectives are just numbers and that the same variable can be used to reference a data multiple times.
But to separate each type of data, a different approach is used to help developers read and understand the code:

  • Some C data types are "used", such as int, char and bool;
  • ThisExample or this_example is only meant to be used as tagging;
  • thisExample is a common variable naming;
  • example can be used, but discouraged;
  • EXAMPLE is seen when the variable is about to modify complex structures.

Data types

Global
  • int:
    Basically a buffer integer.

  • char:
    Same as int, but is meant to separate entity count from timer count.

  • combinerStage:
    TODO

  • thirstCount:
    Player's thirst count.

  • toolDamage:
    Damage of the player tool.
    Necessary for avoiding the tool being broken during the use.

Entity
  • posX, posY, posZ:
    Coordinates of a entity.

  • rotY, rotZ:
    Rotation of a entity.

  • oldPosX, oldPosY, oldPosZ:
    Buffered coordinates of a entity.

  • oldRotY, oldRotZ:
    Buffered rotation of a entity.

  • age:
    Time that a entity have in the world.
    QUESTION: Really necessary?

Time
  • seconds, minutes, hours:
    Real Time time.

  • dayTime:
    TODO

Type
  • boatType:
    ID of a boat type.

  • toolID:
    General item ID.

Storage
  • SLOT0 ... SLOT26:
    Slots from a 3x9 GUI matrix.
Gameplay

Operator

  • GM_Player:
    Current player gamemode.

  • OP:
    Check if player is operator.
    Let player to change their gamemode to other than survival. Also impact on behaviour.

Drink/Food

  • thirstBool:
    Check if player can lose 1 thirst point.

Entity

  • damageTaken:
    Amount of damage suffered from external source.

  • bleedingLvl:
    Level of bleeding spots on entity body.

(Minecraft) Event

Block

  • HSS_Mined_Barrel:
    Flag that detects if player broke a barrel block.

Entity

  • killedIllusioner:
    Flag that detects if Illusioner was killed by the player.
    It will apply the effects to the player.

  • hasKilled:
    Flag that detects if the player was killed.

  • hungerCount:
    Level of hunger of entity.

  • isSneaking, isRunning, isDrinking, isGlowing:
    Flag that detects player actions.

Food

  • eatenFlesh, eatenRabbit, eatenChicken, eatenMutton, eatenPorkchop, eatenBeef, eatenSpiderEye, eatenP_Pie, eatenP_Potato, eatenSalmon, eatenT_Fish, eatenPufferfish, eatenCod:
    Flag that detects if player have eaten every food.
    Affects immunity.

Tools

  • usedW_Axe, usedG_Axe, usedS_Axe, usedI_Axe, usedD_Axe, usedN_Axe, usedW_Pickaxe, usedG_Pickaxe, usedS_Pickaxe, usedI_Pickaxe, usedD_Pickaxe, usedN_Pickaxe, usedW_Hoe, usedG_Hoe, usedS_Hoe, usedI_Hoe, usedD_Hoe, usedN_Hoe:
    Flag that detects if player is using any tool.
    Apply mining fatigue when about to break.

  • usedPearl:
    Flag that detects if player have used a ender pearl.
    If detected a duck/sneak, player will teleport.

  • usedScope:
    Flag that detects if player have used a spyglass.
    Workaround to Rubbish Weapons function.

Modules

Rubbish Weapons

  • loadedGun:
    Flag that detects if player have used a carrot_on_a_stick
    Check if gun is loaded and not have a empty magazine.

  • usedGun:
    Flag that detects if player have used a crossbow

  • slotSection:
    Hotbar count where weapon is being held.

  • isNatoEmpty, isGaugeEmpty, is9mmEmpty, isSniperEmpty, isIglaEmpty:
    Possibly deprecated.

  • natoBullets, gaugeBullets, 9mmBullets, sniperBullets, iglaMissiles:
    Projectile count by fired weapons.

  • natoTiming, gaugeTiming, 9mmTiming, sniperTiming, iglaTiming:
    Interval of shooting.

  • natoAmmo, gaugeAmmo, 9mmAmmo, sniperAmmo, iglaAmmo:
    Weapon's available munition.

  • rowTime:
    TODO

Biohazard

  • biohazardCount:
    Amount of radiation a entity have.

  • hazardSuit:
    Type of radioactive protection suit.

  • hsMaterial:
    Material of protection.

Developer
  • HSSVer:
    Shows the version of the datapack.

  • MCVer:
    Shows the version of the Minecraft. Also sets virtual_master variable. Intended to be used for backward compatibility.

  • debug:
    Shows debug functions in chat.
    Intended for modders.

  • verbose:
    Shows all functions in chat.
    Intended for developers.

  • b0 ... b8:
    Binary memory slots.

  • bM:
    Binary memory mode.

  • bT:
    Binary memory address.

Variables

  • counter:
    General datapack tick/time counter.

  • tickCount:
    Function tick counter (4 * counter).
    Increase the time to load some functions to avoid overloading.

  • potFarmer:
    Tick used for Pot Farmers.

Tags

Variables

  • hss_function_loaded:
    To avoid modules loading functions.

  • hss_last_spot:
    To spawn a waypoint for 1 minute teleport.

  • entity_check, player_check:
    To avoid running the same check to the same entity.

  • placed:
    Normally used to detect custom block placement.

  • tree_fall, ultra_hoe, vein_mine:
    Very laggy area_effect_cloud entities (temporary).

Blocks

hss:acacia_related
hss:amethysts
hss:birch_related
hss:bullet_ricochet_transparent
hss:bullet_ricochet
hss:cannot_hold_gun
hss:corals
hss:dark_oak_related
hss:falling_blocks
hss:jungle_related
hss:leaves
hss:nato_can_break
hss:nato_can_ignore
hss:not_air
hss:oak_related
hss:ores
hss:spruce_related
hss:transparent_blockstate
hss:tree

Entity types

hss:grass_break
hss:undead

Items

hss:all_hyphaes
hss:all_leaves
hss:all_logs
hss:all_mushrooms
hss:all_planks
hss:all_rocks
hss:all_slabs
hss:all_stems
hss:all_stones
hss:all_woods
hss:all_wools
hss:arrow_handles
hss:axes
hss:combustible
hss:paper_craftable
hss:pressure_plates
hss:vegetation

Predicates

hss:is_aglc
hss:is_fal
hss:is_gc_9mm
hss:is_igla
hss:is_m1014
hss:is_rubbish_weapons

Loot tables

Barrels

Container Chance Items
lavarig_barrel 1/8 lava_bucket 1 - 45%, bucket 1 - 25%, ancient_debris 1 - 15%

Chests

Container Chance Items
junkyard_cabin 1/8 cobweb 1~24 - 45%, vine 1~4 - 35%, moss_block 1~2 - 30%, radiationPills 1~8 - 25%, dirt 1~16 - 20%, coal 1~4 - 20%, iron_ingot 1~2 - 15%, magneticBar 1 - 1%
lavarig_chest 1/8 lava_bucket 1 - 45%, radiationPills 1~8 - 40%, gold_ingot 1~4 - 35%, nether_star 1~4 - 30%, netherrack 1~64 - 20%, nether_brick 1~8 - 20%, netherite_ingot 1~2 - 15%, wrench 1 - 1%

Fishing

Fishing is one of the only ways to obtain Blueprints and Tomes.