• Hey! Register here to create your account, engage with the community, and talk about what is new!

The 2.0 Challenge

homchom

Retired Dev
Overlord
Joined
Sep 7, 2020
Messages
10
Reaction score
13
A server event where you only have access to 2.0 code features has been often requested. Although it is almost guarenteed to never happen, it can still be emulated in the current patch. This is a tutorial for the "2.0 Challenge": coding DiamondFire plots using only features that existed in the original patch, 2.0.

Thanks to Jeremaster and TheMaxs for helping me make this post.

1. Actions

You can only use the following code blocks and actions:

  • Player Event:
    • Plot and Server Events: Join Game, Quit Game
    • Click Events: Right Click, Left Click
    • Movement Events: Sneak, Unsneak
    • Damage Events: Take Damage, Player Damage Player, Player Damage Entity, Entity Damage Player
    • Death Events: Death, Player Kill Player, Player Kill Mob, Mob Kill Player, Respawn
  • Player Action:
    • Item Manipulation: Give Items, Remove Items, Clear Inventory*
    • Communication: Send Message*, Play Sound Effect (see section 5)
    • Statistics: Damage, Set Current Health, Set Food Level, Give Experience*, Set Experience*, Give Potion Effect*, Remove Potion Effect*
    • Settings: Set PvP Allowed
    • Movement: Teleport*, Launch Up, Launch Forward
    • World: Launch Projectile (no 'Inaccuracy' parameter)
  • If Player:
    • Toggleable Conditions: Is Sneaking
    • Locational Conditions: Is Looking at Block, Is Standing on Block, Is Near Location*, Is Holding Item (see section 4), Has Item*
  • Game Action:
    • Entity Spawning: Spawn Mob
    • Visual Effects: Create Explosion
  • Control:
    • Wait*
  • Else
  • "Code Warp" (see section 3)

*Default tag options only

Any actions/categories not listed above cannot be used. This also means that you cannot use the following code blocks at all:

  • Entity Event
  • Entity Action
  • If Entity
  • Set Variable
  • If Variable
  • Select Object
  • Repeat
  • Process
  • Start Process

Loop blocks also did not exist at the time. However, you can use the Player Take Damage Event and 'Player Action: Damage' to make a makeshift loop.

2. Values

Only the following value types can be used. Variables and Game Values cannot be used.

  • Text
  • Number
  • Location (X, Y, and Z only; all coordinates must be centered)
  • Sound Effect (see section 5)
  • Potion Effect (see section 4)

3. Code Warps

In DiamondFire 2.0, extending code lines was done with Code Warps. They do not exist in the current patch, so Function and Call Function blocks must be used instead to emulate their behavior. You must adhere to the following rules when using functions:

  1. Each function can only be called once.
  2. Functions can only be called at the end of code lines.
  3. All function names must be positive numbers (no text).

4. Version Restrictions

DiamondFire 2.0 ran on Minecraft 1.8. This means that 1.9+ features cannot be used. Of course, some things (like combat) cannot be avoided. However, if you can avoid using a 1.9+ feature (blocks, items, potion effects, etc), you must do so. This includes the "Off Hand" tag option for 'If Player: Has Item'.

5. Sound Effects

Only the following sound effects can be used:

  • Anvil Use
  • Anvil Break
  • Arrow Shoot
  • Bat Takeoff
  • Blaze Ambient
  • Cat Ambient
  • Cave Ambience
  • Chest Open
  • Chest Close
  • Chicken Lay Egg
  • Chicken Hurt
  • Cow Ambient
  • Creeper Primed
  • Eat
  • Enderman Teleport
  • Enderman Stare
  • Enderman Scream
  • Ender Dragon Growl
  • Ender Dragon Flap
  • Ender Dragon Hurt
  • Ender Dragon Death
  • Experience Orb Pickup
  • Explode
  • Fence Gate Open
  • Fence Gate Close
  • Fire Ambient
  • Fire Extinguish
  • Firework Launch
  • Firework Blast
  • Ghast Scream
  • Ghast Shoot
  • Glass Break
  • Guardian Ambient (Land)
  • Guardian Flop
  • Elder Guardian Curse
  • Horse Gallop
  • Item Break
  • Iron Door Open
  • Iron Door Close
  • Iron Golem Hurt
  • Lightning Thunder
  • Minecart Inside
  • Nether Portal Travel
  • Piston Extend
  • Piston Contract
  • Player Attack (Critical)
  • Player Level Up
  • Player Hurt
  • Pling
  • Sheep Shear
  • Skeleton Horse Death
  • Slime Jump
  • Spider Ambient
  • Splash
  • UI Button Click
  • Villager Ambient
  • Villager Yes
  • Villager No
  • Witch Ambient
  • Wither Spawn
  • Wither Shoot
  • Wither Death
  • Wolf Growl
  • Wolf Howl
  • Wooden Door Open
  • Wooden Door Close
  • Zombie Attack Wooden Door
  • Zombie Attack Iron Door
  • Zombie Hurt
  • Zombie Villager Cure
  • Zombified Piglin Hurt

6. Targets

Only the following targets can be used:

  • Default (%default)
  • Damager (%damager)
  • Killer (%killer)
  • Victim (%victim)
  • All Players
  • Random Player (use 'Select Object: Select Random Player'; this is the only time you can use Select Object)

7. Miscellaneous

There are a few other rules to keep in mind.

  1. WorldEdit cannot be used.
  2. Code templates cannot be used.
  3. Custom hex codes cannot be used.

If there are any questions about any of this, please let me know in the comments. Please also let me know if any of this is inaccurate or if the post needs to be added to. I will make adjustments as needed.

Thanks, and good luck!
-homchom, dev connoisseur



Edit 1: Added info about Loop blocks
 
Last edited:

Wobber

Forum adept
Overlord
Joined
Sep 6, 2020
Messages
1,515
Reaction score
103
i cant tell if this would be fun or extremely painful
 

endersaltz

Moderator
Moderator
Joined
Sep 27, 2020
Messages
38
Reaction score
21
if i were to do this i would not follow the sounds part smh
 

Vulcano

Forum adept
Overlord
Joined
Sep 11, 2020
Messages
243
Reaction score
64
Also, hex codes should not be allowed.
 

Max

Administrator
Administrator
Joined
Sep 6, 2020
Messages
177
Reaction score
32
If I were to do this, I'd probably make some code that emulates 1.8 features (disables offhand + 1.8 pvp)
 

SamMan_

Forum adept
Joined
Sep 6, 2020
Messages
120
Reaction score
72
3. Code Warps

In DiamondFire 2.0, extending code lines was done with Code Warps. They do not exist in the current patch, so Function and Call Function blocks must be used instead to emulate their behavior. You must adhere to the following rules when using functions:

  1. Each function can only be called once.
  2. Functions can only be called at the end of code lines.
  3. All function names must be positive numbers (no text).
Unless this is newer behavior, iirc codewarps could be placed in the middle of lines? (e.g. If xyz -> codewarp) and you could (sometimes, it was inconsistent) have use the same warp multiple times.

Also, at the end of each codewarp there should be a control: end (no returning from codewarps)
 

Vulcano

Forum adept
Overlord
Joined
Sep 11, 2020
Messages
243
Reaction score
64
how would you emulate the pvp tho
i dont think you would have to follow these guidelines for that, as it does nothing but make it more accurate to how it was originally played
 

homchom

Retired Dev
Overlord
Joined
Sep 7, 2020
Messages
10
Reaction score
13
Unless this is newer behavior, iirc codewarps could be placed in the middle of lines? (e.g. If xyz -> codewarp) and you could (sometimes, it was inconsistent) have use the same warp multiple times.

Also, at the end of each codewarp there should be a control: end (no returning from codewarps)
that shouldn't be an issue if you only place on at the end of lines. also with them being in the middle of lines, i could never get this to work. at the very least, i think it was buggy. i guess if i'm wrong it needs to be changed? i'd like to wait for more feedback first though
 
Top Bottom