Skip to content

NeverminedDE/paintball-resourcepack

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

paintball-resourcepack

Changelist

snowball

icon name customModelData
black_gun 1
red_gun 2
green_gun 3
aqua_gun 4
blue_gun 5
purple_gun 6
cyan_gun 7
light_gray_gun 8
gray_gun 9
pink_gun 10
lime_gun 11
yellow_gun 12
light_blue_gun 13
magenta_gun 14
orange_gun 15
white_gun 16
black_snowball 17
red_snowball 18
green_snowball 19
aqua_snowball 20
blue_snowball 21
purple_snowball 22
cyan_snowball 23
light_gray_snowball 24
gray_snowball 25
pink_snowball 26
lime_snowball 27
yellow_snowball 28
light_blue_snowball 29
magenta_snowball 30
orange_snowball 31
white_snowball 32

plugin changes

This code needs to be included in the plugin for the guns to work corectly. Otherwise you would be shooting guns instead of balls.

ProjectileLaunchListener.class

public class ProjectileLaunchListener implements Listener {

    @EventHandler
    public void onProjectileLaunch(ProjectileLaunchEvent event) {

        if (event.getEntity() instanceof Snowball) {
            Snowball s = (Snowball) event.getEntity();

            ItemStack item = s.getItem();
            ItemMeta meta = item.getItemMeta();

            if (meta != null && meta.hasCustomModelData()) {
                int data = meta.getCustomModelData();

                // convert from gun to snowball
                if (data > 0 && data < 17) {
                    meta.setCustomModelData(data + 16);
                    item.setItemMeta(meta);
                    s.setItem(item);
                }
            }
        }

    }
}

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published