Skip to content

solarrabbit99/GoatHorn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GoatHorn

License Spigot Downloads Commit Activity Discord Codacy Badge

Introduction

The goal of this project is two-fold:

  1. Provide a plugin that implements goat horns, which are experimental features in Bedrock edition, planned to be released on 1.18. Java edition shall have equivalent experience with the item, and we are lucky for it to be possible to be implemented in 1.17.x. The only difference is that horns are looted via killing the goat instead of making goats ramp blocks - a behaviour that has yet to be present in Java 1.17.x.

  2. Provide an API for developers to decide on whether blaring a goat horn trigger any in-game events (such as raids, buff effects, summoning of mobs etc). This is possible via the introduction of PlayerBlareHornEvent.

Maven Repository

You can add the project as your dependency by including the JitPack repository in your pom.xml:

<repositories>
	<repository>
		<id>jitpack.io</id>
		<url>https://jitpack.io</url>
	</repository>
</repositories>

Then after add the dependency like so (replace VERSION with the version provided by the jitpack badge located at the start of this document):

<dependency>
	<groupId>com.github.zhenghanlee</groupId>
	<artifactId>GoatHorn</artifactId>
	<version>VERSION</version>
</dependency>

Gradle Repository

You can add the project as your dependency by including the JitPack repository:

allprojects {
	repositories {
		...
		maven { url 'https://jitpack.io' }
	}
}

Then after add the dependency like so (replace VERSION with the version provided by the jitpack badge located at the start of this document):

dependencies {
	    implementation 'com.github.zhenghanlee:GoatHorn:VERSION'
}

Example

To disable player from blaring horns:

@EventHandler
public void onBlareHorn(PlayerBlareHornEvent event) {
    if (event.getPlayer().hasPermission("server.rank.example"))
        event.setCancelled(true);
}

Calling a raid if player is in the vacanity of a village:

@EventHandler
public void onBlareHorn(PlayerBlareHornEvent evt) {
    evt.getPlayer().addPotionEffect(new PotionEffect(PotionEffectType.BAD_OMEN, 1, 5));
}

About

Implementation of Bedrock 1.18's goat horns in Java 1.17+.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages