Skript: 1.13 support

Created on 19 Jul 2018  路  31Comments  路  Source: SkriptLang/Skript

See also #1385 - new features we can add to Skript once it runs on 1.13.

New aliases are still work in progress, but not that incomplete. Updating Java code ready for 1.13 has also started.

  • [x] Update new aliases system for 1.13
  • [x] Purge references to Material entries from Java code, use aliases instead for cross-version compatibility
  • [x] Remove the few usages of numeric ids outside of aliases system
  • [x] Update biome mappings
  • [x] Update other things that used to rely on deprecated APIs (IDK what exactly)
  • [x] Update click events to work correctly with Mojang's bug fix
  • [x] Make variables containing items from 1.12 to be correctly migrated

... and while doing these things, support for 1.9+ must kept. I expect that to be quite annoying.

completed enhancement critical

Most helpful comment

Skript now compiles against 1.13. Still needs some work to get it running.

All 31 comments

I said this in Discord after my testing but just so it's here for conversation and ease of access: the vanilla change to click handling in 1.13 is that blocks now ALWAYS override your off hand if they're in your main hand. Items still fall through based on context (if you are full on hunger with food in your main hand, it will attempt to use your off hand), but if you have a block in your main hand your off hand will not be used, even when right clicking in a situation where the block can't be placed.

This is good because by far the largest difficulties in programmatically determining which hand was used in a click event were surrounding blocks since there are complicated and specific situations which determined if the block was placed or not. With items in the main hand it's much more straightforward to tell if they're going to be used when compared to blocks. And to aid with that, here's a list of useable items and the situations in which their event will succeed when in the main hand to aid in updating the determining code (which is in checkUseOffHand in EvtClick). Shout if you notice one I missed or any mistake:

  • Bow: if the player has any type of arrow (normal, spectral, tipped)
  • Empty bucket: if they click on water or lava... I guess? Liquids don't fire a block click event AFAIK, so a bit weird. PlayerBucketEvent may help.
  • Water bucket: if isBlockInHand() on the interact event is true OR (1.13) if they're right clicking on any fish (can carry fish in water buckets in 1.13)
  • Lava bucket, Flint and Steel, OR (1.13) Bucket of Fish: if isBlockInHand() on the interact event is true (I assume placing the liquid/fire counts as a block place event, too? That'd make it easier but not sure if that works here)
  • All hoes: when clicking grass, dirt, grass paths, OR coarse dirt (turns the latter back into dirt)
  • All shovels: when clicking grass
  • All axes: (1.13) when clicking logs or bark blocks (that's how stripped log blocks are made)
  • Leash: when clicking on a leashable entity (may need to be determined manually). PlayerLeashEntityEvent may help.
  • Shears: when right clicking a sheep with wool (!e.isSheared()), snow golem that still has its pumpkin, (!e.isDerp()), or a mooshroom.
  • Ender pearl OR shield: if it's not on cooldown (!player.hasCooldown(material))
  • Spawn egg: if they clicked a block
  • Any food: when hungry
  • Trident: if it has Riptide, only when it's raining or the player is in water. Otherwise, always.
  • Egg, splash potion, snowball, fishing rod, eye of ender, book and quill, written book, empty map, both golden apples: always

You'll still need special checks like seeing if they clicked an interactable block while not sneaking, but there should be less bugs and falsely reported events as far as which hand performed the action. And now you can straight up say "if the main hand is a block, event-hand is main hand".

so do the new aliases have a way to get a Material from an alias, then?

Yes.

Any ways how non-java-coders could pitch in?

yes, contribute to the skript-aliases repo. it is the main thing holding aliases back right now, there's a bit of a tutorial in the read me over there

those are dev builds that have been out for a little while now

This might be worth checking (in general and specifically for 1.13) - https://github.com/SkriptLang/Skript/blob/80c6f13e4d43f17e7f668867906806b39cd6e802/src/main/java/ch/njol/skript/expressions/ExprRemainingAir.java#L101-L106
20 ticks as a default amount of air? it's 1 second

20 air is still default state as far as I know. Minecraft just doesn't reset to default immediately when exiting water, as it used to do.

@bensku but wouldn't it mean that one has only 1 second of air after diving into the water before they start getting damaged? Sorry if I misunderstand what this value is

Oh. Yeah, that is correct. I had thought it was represented in same way as player health, but that is of course a mistake.

No that's how it was back in older versions. I'm pretty sure the air has been changed to be longer and also when you gain air it's delayed. Rather than gaining all air back when you get air, it takes like 5 ticks to gain each air bubble. This is to simulate regaining your breath.

Skript now compiles against 1.13. Still needs some work to get it running.

you can know how much the update will take.
I really care about time

@xGlenor @Nicofisi already explained this to you in the other issue that you opened.

I forgot, I'm sorry

Soo.. When will the stable version be on 1.13?

@Nuker321 there isn't even a stable version of Spigot for 1.13 yet. Please be patient and just wait for it.

@Nuker321 it's not like there is a timeline for these things -- all the devs work on the things that interest them when they have time and want to.

There are currently no stable versions of Skript out for Minecraft 1.9 or later. We do have one in plans, but I really have no idea how soon.

First usable 1.13 release will be not marked as stable, but for some users it might be good enough.

@bensku when it will be available

he can't see the future

Be patient. Stop asking. When it's ready for testing, you'll see the release.

Hello. I'm new to GitHub. Cannot code Java, but can try to do some other things. How can I help???
Also, you might want to see issue #1385 ...

@redbrain1014 You can propably help here: https://github.com/SkriptLang/skript-aliases

Soooo it has been nearly a month now since the "compiles against 1.13" comment and while im aware i should be patient i cant really afford to wait longer.
Can i pay someone to resolve this? A non-backwardscompatible 1.13 version would already be fine, no need to import variables either. Any volunteers? rather ask here first before i move on and deal with configuring replacements

@melinstagibson the best person you could pay to move along development is @bensku (logically thinking, i'm not sure whether he accepts donations like that though). Porting Skript to 1.13 is a massive undertaking and if you'd pay an outsider ... i'd assume there'd be a LOT of working hours to pay for.

Spigot does not have a stable 1.13 release, and even Minecraft 1.13 is quite unstable (1.13.1 is better, apparently). Skript or no, hosting a public 1.13 server that is not a protocol hack right now would be a gamble.

That being said, Skript runs on 1.13, and all the available aliases are enabled without errors. And alpha release will likely be published once transportation category is ready too. Using that on a public server would be - in theory - possible, provided that you really do not care about what happens to your variables and take frequent backups.

Hello. I'm new to GitHub. Cannot code Java, but can try to do some other things. Is there anything left I can do?
Also, you might want to see issue #1385 ...

Everything should be somewhat functional now, but the result is quite buggy. I'll spend a few days trying to fix the worst of it, and then probably release something.

Tracking additional functionality at #1385

Was this page helpful?
0 / 5 - 0 ratings