File tree Expand file tree Collapse file tree 5 files changed +56
-53
lines changed
java/org/rainas/nohealthhunger Expand file tree Collapse file tree 5 files changed +56
-53
lines changed Original file line number Diff line number Diff line change 1
- # no-health -hunger
2
- ## Bukkit plugin that disables health and hunger
1
+ # no-damage-no -hunger
2
+ ## Spigot plugin that disables damage and hunger
3
3
4
4
### Features
5
- * Disables health
5
+ * Disables damage
6
6
* Disables hunger
7
- * Teleports players in the void to spawn
8
7
9
8
### Permissions
10
9
| Node| Default| Description|
11
10
| :---| -------| ----------:|
12
- | NoHealthHunger.nohealth| OP| Player takes no damage|
13
- | NoHealthHunger.nohunger| OP| Player loses no hunger|
14
- | NoHealthHunger.escapevoid| TRUE| On entering void, player is teleported to spawn|
15
-
16
- ### Config
17
- | Node| Sample| Description|
18
- | :---| ------| ----------:|
19
- | escapevoid.teleport_out_of_void| true| Set _ false_ to prevent all players from escaping the void (NOTE: This overrides permissions!|
20
- | escapevoid.message| Please don't go on spacewalks.| Message that players see when they are teleported _ out_ of the void.|
21
- | spawn.world| Server_lobby| The name of the world that your spawn point is located in. This is usually the name of the folder containing the world data files.|
22
- | spawn.x| 0.5| The x-coordinate of the spawn point. Press F3 in-game to view your coordinates.|
23
- | spawn.y| 3| The y-coordinate of the spawn point. Press F3 in-game to view your coordinates.|
24
- | spawn.z| 0.5| The z-coordinate of the spawn point. Press F3 in-game to view your coordinates.|
11
+ | NoDamageNoHunger.nodamage| OP| Player takes no damage|
12
+ | NoDamageNoHunger.nohunger| OP| Player loses no hunger|
Original file line number Diff line number Diff line change 1
1
<project xmlns =" http://maven.apache.org/POM/4.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" >
2
2
<modelVersion >4.0.0</modelVersion >
3
- <groupId >org.rainas </groupId >
4
- <artifactId >NoHealthHunger </artifactId >
5
- <version >1.0.1 </version >
3
+ <groupId >io.github.itasli </groupId >
4
+ <artifactId >NoDamageNoHunger </artifactId >
5
+ <version >1.0</version >
6
6
<build >
7
7
<plugins >
8
8
<plugin >
9
9
<groupId >org.apache.maven.plugins</groupId >
10
10
<artifactId >maven-compiler-plugin</artifactId >
11
+ <version >3.8.1</version >
11
12
<configuration >
12
- <source >1.7 </source >
13
- <target >1.7 </target >
13
+ <source >1.8 </source >
14
+ <target >1.8 </target >
14
15
</configuration >
15
16
</plugin >
16
17
</plugins >
17
18
</build >
18
19
<repositories >
19
- <repository >
20
- <id >bukkit-repo </id >
21
- <url >https://hub.spigotmc.org/nexus/content/groups/ public/</url >
22
- </repository >
20
+ <repository >
21
+ <id >papermc </id >
22
+ <url >https://papermc.io/repo/repository/maven- public/</url >
23
+ </repository >
23
24
</repositories >
24
25
<dependencies >
25
26
<dependency >
26
- <groupId >org.bukkit</groupId >
27
- <artifactId >bukkit</artifactId >
28
- <version >1.8-R0.1-SNAPSHOT</version >
29
- <type >jar</type >
30
- <scope >provided</scope >
31
- </dependency >
27
+ <groupId >io.papermc.paper</groupId >
28
+ <artifactId >paper-api</artifactId >
29
+ <version >1.18-R0.1-SNAPSHOT</version >
30
+ <scope >provided</scope >
31
+ </dependency >
32
32
</dependencies >
33
33
</project >
Original file line number Diff line number Diff line change 1
- package org . rainas . nohealthhunger ;
1
+ package io . github . itasli . nodamagenohunger ;
2
2
3
3
import org .bukkit .entity .Player ;
4
4
import org .bukkit .event .EventHandler ;
8
8
import org .bukkit .event .entity .EntityDamageEvent .DamageCause ;
9
9
10
10
public class HealthHungerListener implements Listener {
11
- NoHealthHunger plugin ;
11
+ NoDamageNoHunger plugin ;
12
12
13
- public HealthHungerListener (NoHealthHunger plugin ) {
13
+ public HealthHungerListener (NoDamageNoHunger plugin ) {
14
14
this .plugin = plugin ;
15
15
}
16
16
17
17
@ EventHandler
18
18
public void onEntityDamage (EntityDamageEvent event ) {
19
19
if (event .getEntity () instanceof Player ) {
20
20
Player player = (Player ) event .getEntity ();
21
- if (player .hasPermission ("NoHealthHunger .nohealth" )) {
21
+ if (player .hasPermission ("NoDamageNoHunger .nohealth" )) {
22
22
event .setCancelled (true );
23
23
}
24
-
25
- if (event .getCause () == DamageCause .VOID ) {
26
- if (plugin .doVoid && player .hasPermission ("NoHealthHunger.escapevoid" )) {
27
- player .teleport (plugin .spawn );
28
- player .sendMessage (plugin .voidMessage );
29
- }
30
- }
31
24
}
32
25
}
33
26
34
27
@ EventHandler
35
28
public void onFoodLevelChange (FoodLevelChangeEvent event ) {
36
29
if (event .getEntity () instanceof Player ) {
37
30
Player player = (Player ) event .getEntity ();
38
- if (player .hasPermission ("NoHealthHunger .nohunger" )) {
31
+ if (player .hasPermission ("NoDamageNoHunger .nohunger" )) {
39
32
event .setCancelled (true );
40
33
}
41
34
}
Original file line number Diff line number Diff line change
1
+ package io .github .itasli .nodamagenohunger ;
2
+
3
+ import org .bukkit .Bukkit ;
4
+ import org .bukkit .Location ;
5
+ import org .bukkit .plugin .java .JavaPlugin ;
6
+
7
+ public class NoDamageNoHunger extends JavaPlugin {
8
+
9
+
10
+ @ Override
11
+ public void onDisable () {
12
+ getLogger ().info ("Plugin disabled" );
13
+ }
14
+
15
+ @ Override
16
+ public void onEnable () {
17
+ getLogger ().info ("Plugin enabled" );
18
+ Bukkit .getServer ().getPluginManager ().registerEvents (new HealthHungerListener (this ), this );
19
+ }
20
+
21
+ }
Original file line number Diff line number Diff line change 1
- name : NoHealthHunger
2
- main : org.rainas.nohealthhunger.NoHealthHunger
3
- version : 0.0.1
1
+ main : io.github.itasli.nodamagenohunger.NoDamageNoHunger
2
+ name : NoDamageNoHunger
3
+ version : 1.0
4
+ description : This plugin cancel damage and hunger if player has the permission !
5
+ api-version : 1.18
6
+ author : itasli
7
+ website : spigotmc.org
4
8
permissions :
5
- NoHealthHunger.nohealth :
9
+ NoDamageNoHunger.nodamage :
6
10
description : Take no damage
7
11
default : op
8
- NoHealthHunger .nohunger :
12
+ NoDamageNoHunger .nohunger :
9
13
description : Never go hungry
10
- default : op
11
- NoHealthHunger.escapevoid :
12
- description : Teleport to spawn on entering the void
13
- default : true
14
+ default : op
You can’t perform that action at this time.
0 commit comments