gnembon / scarpet

Public Repository of scarpet programs for Minecraft
Creative Commons Zero v1.0 Universal
359 stars 161 forks source link

Elytra Swap #339

Open IceWolf23 opened 2 years ago

IceWolf23 commented 2 years ago

Elytra Swap with any Chestplate Armor By right-clicking with an elytra or any chestplate this script will swap the items

global_swappable_items = ['netherite_chestplate','diamond_chestplate','iron_chestplate','golden_chestplate','chainmail_chestplate','leather_chestplate','elytra'];

__on_player_uses_item(player, item_tuple, hand) -> (

    if ( hand == 'mainhand' && (inventory_get(player, 38)) != null, (

        if ( global_swappable_items ~ (item_tuple:0) != null, (

                playerArmorDressed = inventory_get(player, 38);
                handSlot = query(player, 'selected_slot');

                inventory_set(player, handSlot, 1, playerArmorDressed:0, playerArmorDressed:2);
                inventory_set(player, 38, 1, item_tuple:0, item_tuple:2);

                return()
                )
            )
        )
    )
);
altrisi commented 2 years ago

Assuming you want to get these into the repo: You should make a Pull Request, that's the way github works for suggesting changes to files in the repo.

IceWolf23 commented 1 year ago

Assuming you want to get these into the repo: You should make a Pull Request, that's the way github works for suggesting changes to files in the repo.

Thanks!