#help-development
1 messages · Page 1455 of 1
soooo how to do that?
huuh whats wrong here?
does setMaxStackSize change the entire inventory?
like if I set it to 2 all slots in the menu can only stack up to 2
why when you break a flower it doesnt go in "blockbreakevent"
you shouldn't declare wildcard permissions yourself
leave *'s to the permission plugin's parsing
how to set the slot of the item
if you want to create a parent permission that gives a player a bunch of different child permissions, name it something like MagmaBuildNetwork.all
an item does not have a slot
you can not set the slot of the item
because the item does not have a slot
the slot has an item
you can set the item of a slot
how to do that??
is this the case?
still confused
i don't know whether it works that way, try it and see I suppose
Im doing new Inventory()
{}
yeah don't do that
is that what youre suppose to do
use Bukkit.createInventory or whatever
ok
i hardly ever use the max stack size attribute since it doesn't work well on the client-side
the client doesn't get any information about your max stack sizes so shit will jitter and flicker around a bunch
ok
how
setContents takes an entire Array of itemstacks
it sets all of the items in the inventory at once
see the javadocs for the right method
whats the even when a block is placed
it isn't that hard
event*
well i did and it doesnt work
is BlockPlaceEvent deprecated?
check it ?
oh
i did
ok ty
but it says it doesnt find it
?jd
package index
javadocs are pretty helpful
if it can't find it it isn't deprecated; it doesn't exist
setContents takes a 1D array of ItemStack yes?
true, just now i get it
yes
thanks
if it were a 2D array it'd be ItemStack[][]
oh right
why is that stupid yml not working :/
what method creates a ItemStack
so this
FillerPanel = new ItemStack(Material.GRAY_STAINED_GLASS_PANE,1);
variables should start with a lowercase character
capitalized names are reserved for classes
ItemStack fillerPanel =
lmao forgot to put : true inside my yml
huh still does not work
name: MagmaBuildNetwork
version: 1.0
main: io.github.FourteenBrush.MagmaBuildNetwork.MagmaBuildNetwork
author: FourteenBrush
soft-depend: [LuckPerms]
commands:
reload:
description: Reloads the plugin
usage: §2/<command>
permission: <plugin name>.reload
permission-message: You don't have <permission>
ignite:
description: Sets a player on fire
usage: §2/<command> [player]
permission: <plugin name>.ignite
permission-message: You don't have <permission>
freeze:
description: Freezes a player
usage: §2/<command> [player]
permission: <plugin name>.freeze
permission-message: You don't have <permission>
heal:
description: Heals a player
usage: §2/<command> [player]
permission: <plugin name>.heal
permission-message: You don't have <permission>
lock:
description: Allows you to protect a container
usage: §2/<command>
permission: <plugin name>.basic
permission-message: You don't have <permission>
store:
description: Stores a message inside the NBT tags of an item
usage: §2/<command> [message]
permission: <plugin name>.store
permission-message: You don't have <permission>
stats:
description: Shows player stats
usage: §2/<command>
permission: <plugin name>.basic
permission-message: You don't have <permission>
permissions:
MagmaBuildNetwork.*:
description: Gives access to all MagmaBuildNetwork commands
children:
MagmaBuildNetwork.reload: true
MagmaBuildNetwork.ignite: true
MagmaBuildNetwork.freeze: true
MagmaBuildNetwork.heal: true
MagmaBuildNetwork.store: true
MagmaBuildNetwork.basic: false
MagmaBuildNetwork.admin:
description: Gives access to all admin commands
default: op
MagmaBuildNetwork.basic:
description: Gives access to all player commands
default: true
?paste
is crying
read what I told you earlier
it always worked with .*
i didn't tell you not to use .* because it breaks the yml
i told you not to use it because you're not supposed to use it
but at least you've made progress
well tell me any idea what's wrong?
does your IDE not have autoformatting ?
idk if its enabled or something
it does have formatting but it doesn't have proper syntax highlighting for stuff like indents
it said line 45 wrong but it was 57 ._.
it
GM+ is a fork of my GM. GM+ is also outdated and lacking features.
gm+ is better than gm because it has a +
Of course
Obviously
premium
Is there 1.16 version of packetwrapper?
Packet wrapper was made by a script if you look at the GitHub
I will use your plugin it says outdated
What says outdated?
uhh
[19:38:46] [Server thread/ERROR]: Could not pass event PlayerInteractEvent to MagmaBuildNetwork v1.0
org.bukkit.event.EventException: null
is that the only exception ? xD
usually it is followed by a Caused by somewhere down the line
well now i have a nullpointer
Error occurred while enabling MagmaBuildNetwork v1.0 (Is it up to date?)
java.lang.NullPointerException: null
at io.github.FourteenBrush.MagmaBuildNetwork.MagmaBuildNetwork.onEnable(MagmaBuildNetwork.java:40) ~[?:?]
at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:263) ~[spigot.jar:git-Spigot-37d799b-3eb7236]
at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:351) ~[spigot.jar:git-Spigot-37d799b-3eb7236]
at org.bukkit.plugin.SimplePluginManager.enablePlugin(SimplePluginManager.java:480) ~[spigot.jar:git-Spigot-37d799b-3eb7236]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugin(CraftServer.java:494) ~[spigot.jar:git-Spigot-37d799b-3eb7236]
at org.bukkit.craftbukkit.v1_16_R3.CraftServer.enablePlugins(CraftServer.java:408) ~[spigot.jar:git-Spigot-37d799b-3eb7236]
at net.minecraft.server.v1_16_R3.MinecraftServer.loadWorld(MinecraftServer.java:435) ~[spigot.jar:git-Spigot-37d799b-3eb7236]
at net.minecraft.server.v1_16_R3.DedicatedServer.init(DedicatedServer.java:218) ~[spigot.jar:git-Spigot-37d799b-3eb7236]
at net.minecraft.server.v1_16_R3.MinecraftServer.w(MinecraftServer.java:808) ~[spigot.jar:git-Spigot-37d799b-3eb7236]
at net.minecraft.server.v1_16_R3.MinecraftServer.lambda$0(MinecraftServer.java:164) ~[spigot.jar:git-Spigot-37d799b-3eb7236]
at java.lang.Thread.run(Unknown Source) [?:1.8.0_291]
[19:40:56] [Server thread/INFO]: Server permissions file permissions.yml is empty, ignoring it
[19:40:56] [Server thread/INFO]: Done (14.230s)! For help, type "help"
well then there you go
what
it literally tells you the line and class to look
what more do you need lol
line 40 you mean?
yes
is it normal that this gives an error?
Block block = event.getClickedBlock();
Player p = event.getPlayer();
TileState state = (TileState) block.getState();
last line
not every block state is a tile state
you will need to check it
using instance of
look this is the code (to lock a chest/barrel etc)
```java
@EventHandler // Lock method
public void onContainerClick(PlayerInteractEvent event) {
Block block = event.getClickedBlock();
Player p = event.getPlayer();
TileState state = (TileState) block.getState();
PersistentDataContainer container = state.getPersistentDataContainer();
NamespacedKey key = new NamespacedKey(plugin, "MBN");
if (MagmaBuildNetwork.playersWantingLock.contains(event.getPlayer().getUniqueId())) {
if (event.getAction() == Action.RIGHT_CLICK_BLOCK && block.getState() instanceof InventoryHolder
&& block.getState() instanceof Lockable && block.getState() instanceof TileState) {
event.setCancelled(true);
container.set(key, PersistentDataType.STRING, p.getUniqueId().toString());
state.update(); //apply the lock!
p.sendMessage(ChatColor.DARK_GREEN + "Locked!");
MagmaBuildNetwork.playersWantingLock.remove(event.getPlayer().getUniqueId());
} else {
p.sendMessage(ChatColor.DARK_GREEN + "This block can't be locked");
MagmaBuildNetwork.playersWantingLock.remove(event.getPlayer().getUniqueId());
}
}
if (!(container.has(key, PersistentDataType.STRING))) {
return;
}
if (event.getPlayer().getUniqueId().toString().equalsIgnoreCase(container.get(key, PersistentDataType.STRING))) {
return;
} else {
event.setCancelled(true);
p.sendMessage(ChatColor.RED + "You cannot open this!");
}
}
?paste
yea i know...
again
please use it then xD
also, you are casting this before you check
not like you would smash your head into a wall and then afterwards check if there is a wall or not
wait uhh where exact?
top, storing state
in the line where you cast it ? TileState state = ...
LMAO
can some on help me?
Player p = (Player) ball.getShooter();```
java.lang.NullPointerException: Cannot invoke "org.bukkit.entity.Player.getWorld()" because "p" is null
so i would check if the block has a state?
yes
but if that state is a "TileState"
the method returns a BlockState, which may or may not be a TileState
only blocks with like persistent inventory or other fun stuff are TilEStates
it returns a Vehicle; it could be a Car
but it might not be
it might be a Bicycle
don't treat it as if it were a Car without checking whether it's a Car
tell me whan u done
This error can;t be from that code, as it would fail casting the shooter to player.
what
For p to be null it must have got past that code, in which case p can;t be null
so if (block instanceof TileState)
public void onProjectileHit(ProjectileHitEvent e){
Arrow ball = (Arrow) e.getEntity();
Player p = (Player) ball.getShooter();```
for p to be null the cast to player of getShooter() would be impossible if getShooter() was null
BlockState state = block.getState();
if (state instanceOf TileState) {
TileState stateButAsTileState = (TileState) state;
}
My statements still stand
projectile may not be an arrow and getShooter may not be a player
so make an if?
you can getShooter from event.getProjectile()
it will be an Entity, you need to test to see if its a player before casting
getShooter() can also be null or a dispenser
oof
same with Arrow. You need to test the return from getProjectile to make sure it is an Arrow
eg, Ghast shoots a fireball. Not an Arrow and not a Player
like this?
https://paste.md-5.net/caxiwigacu.cs
yes
yes, method is correct. all his code is wrong
If the state isn't a tile state the stateButAsTileState variable will be null and the getPersistentDataContainer call will produce a nullpointer
:( jk
try and catch?
so how to fix ittt
no xD
or is there an easier way?
if (!(state instanceof TileState)) return;
wait wait wait i used in my plugin the 1.16.5 api but it still works on 1.14.4 what????
I mean, I'd suggest a layout as follows: ```java
Block block = ....
BlockState state = block.getState();
if (!(state instanceOf TileState)) return;
TileState tileState = (TileState) state;
ye
what elgar said
i swear i used 1.16.5 spigot api in my mc plugin and it works on a 1.14.4 server i didnt know that would work lol
if you don't call methods that are specifically only available in the new versions
it isn't an issue
oh lol
as long as you don't use any methods that didn't exist at the time, it'd work on 1.8 for all it gave a shit
you obviously also did not set your api-version in your plugin yaml
and a chest has a tilestate?
and you forgot to specify an API version in your plugin.yml
nah i didnt
Yeah, if you would it would explode
which is good, because if you want to officially support 1.14 code against that version
i didnt want to set a api version really and i dont think im gonna use any new stuff XD
then make sure to actually code against the lowest version you support
well rn all i know that the code i wrote rn works in 1.14.4
if that is what you want to support you should switch to that version
plugin will work in 1.15 and 1.16
then set the API version in the plugin.yml to 1.14 so you don;t get teh annoying nag message at startup
because md69 would rather die than have an old plugin not "work"
what message
whether it works properly is another matter
i dont get any message
so a custom plugin of mine that uses Towny's API is breaking on recent paper or spigot builds. https://paste.gg/p/anonymous/a0eb0a632ade46ff9ae8f0d4c35757ad - the error is an NPE in towny but they're saying it's likely my code, but this code worked fine on paper b674. the line in my plugin is TownyAPI.getInstance().getResident(player.getName()) which seems pretty clear it's not me doing something insane. the paper guys say it's due to spigot changing classloaders recently? I don't know what that affects. https://paste.gg/p/anonymous/fe97b5f922f9414382b99170fad7cfb0
towny itself works fine, so idk wtf is wrong
it only just adds a * on the plugin name
check your latest.log for messages about your plugin
learn java
if (!(event.getEntity().getShooter() instanceof Player)) return;
what are ```public enum PlayerRole {
IMPOSTER, CREWMATE, LOBBY, GHOST;
}```
called?
Then why are you making a plugin...
are you making among us
no its from a guy who made among us
lol
but i was just wondering what that code is
instanceof
it is a java enum
its a enum lol
an enumeration
enums are final i think
yes
i dont know java :(
go through some online tutorials first then
hm let me google it
each value declared in the class is a singleton instance of that enum class
Just Fucking Google It helps you help others to use Google and search on their own!
biting your teeth out trying to code a plugin when really not knowing the basics won't get you anywhere
yum i never used enums for anything lol
cuz i never had anything that i had to use them for yet
report
^^
Material.STONE is an enum constant
ChatColor used to be one
no i meant making my own enums lol
I mean, adventure components for the win
because making the bukkit chatcolor enum not an enum would break ABI
which would bork old plugins
99% of Bukkit/spigot is Interfaces and Enums
why is it even in the bungeecoord side when its not just for bungeecoord
mostly interfaces
theres not even any abstract classes really if u know one tell me but i dont think spigot has abstract classes in it
oh boy
There are a few, Abstract event classes
all events are classes for that matter
oh lol
if u extend another class isnt it technically extending two classes in java like the Object class and the class your extending
most of the configuration framework is abstract
wait what
the conversation api has major parts written in abstract classes
Enchantments live in an abstract class
so what now
how can i exclude entities from getting the persistent data container?
did u register the event
yes
the MapRenderer class is also abstract
what doesnt work
point being xD A bunch of stuff is abstract
i thought it wasnt
getting ?
i thought there was none
your decision
move the Player return test to the very top. Early exit so nothing runs if that test fails.
which still makes me sad to this point in time
it's a kind of strange design choice but ig i can see why it was made
ItemStack could have been such a cute Builder and Interface combo
then we would not be cloning item metas left and right
i don't know if that can be blamed on it being a concrete class
we would also have consistency between ItemStack and CraftItemStack
I mean, ItemMeta mainly has to be cloned because the ItemStack cannot directly wrap the nms variant
because they are slow
i mean yeah but making it not concrete wouldn't help
what happens when i remove something from an arraylist thats not actually in it
you would still have to convert the nms meta into bukkit meta
nothing
at least with the way how itemmeta is set up rn
you might get a error i dont know tbh but i dont think you do
is there a way to know if it worked or just did nothing
nah, removing something from a list that isn't there just returns false
but that is it
uh i think it returns a boolean
k ty
yeah, i've been working on a live-view wrapper itemmeta impl on and off for a while
to complement my hitlerstacks
which is my implementation of itemstack
oh were you the one that PRed that to paper ?
probably not
i don't really contribute to things
sadness
whats the difference between CraftItemStack and ItemStack?
the CraftItemStack basically just points to the mojang version of an itemstack
which is a lot faster than the ItemStack class
which copies all of the tags over
ah does that mean that it might not support other versions?
itemstack aka bukkitstack is a cloned bukkit representation of the nms stack
has nothing to do with versions
the only thing you have to care about is that craftstack is better for comparisons
well yeah but nms only supports one version
and bukkitstack is better for repeated edits
when do you use ItemStack lol
in your plugin
when you want to create an item stack
you don't ever actively use CraftItemStack
it is part of the server not the spigot-api
CraftItemStack extends ItemStack and hence is sometimes returned to you when you receive an ItemStack from the API
like in case of an event
wait how is that possible if they cant distribute nms code?
what
they don't distribute it
that is the reason why you build it using build tools
they distribute a script that downloads nms code from mojang
and applies spigot's changes to it
and shits out the server jar
since it doesn't contain the nms code in the script itself it's fair game
wait then how is it legal then
it's legal because they don't distribute it
they distribute a thing that downloads it
We should stop using "deploy" and use "shit out"
maven shit out plugin
it is the scientifically accurate version
latey my ci pipeline has been shitting out a lot of helm charts onto my cluster
i am not a player :(
nah its just that shooter must not be a instanceof player
is there a way to get the item names as String[] from Material#values();
Java Stream API
i never used that lmao what does that do exactly
go go google
streams are haram
concerning their speed, probably
?
How are you launching yoru projectile?
If you are using launchProjectile method, but sure to use the one where you can pass the player as the entity
Parallel streams can be quite nice tho if appropriate
I cant remember teh actual method
Lol
its because e.getEntity().getShooter() isnt a instance of player
are you using a bow to fire your projectile?
console
ItemEvent.java:32
this is all the class
if(p.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals("§6§lרובה פארטיקלס")){
ball.getShooter() is null
Your arrow is never going to have a shooter, because you never set one
lol
how to set one?
read the docs
cast to Projectile and .setShooter()
and how i get the player?
your player is teh one doing the clicking
yes?
that was a statement not a question
idk
I have no idea how your code isn't blowing up trying to cast null to Player
i mean its only a null pointer exception lol
anyway, set the shooter in yoru PlayerInteractEvent
It shoudl be blowing up on line 28
but its only blowing up on 32
maybe u can cast null to Player?
you can’t cast null to Player lol
i dont think it blows up if u cast null tho
I would have thought so, but he's not
it says this online tho
idk if its true tho
I'm suprised
oh sory i wes in a call
I guess my null handling is so perfect I've never tried 😛
i mean if u cast null wouldnt it just be null
I would have expected a class cast exception
bombing intensifies
wait that exists
Aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
i would have though it would be a nullpointerexception since its null
set the shooter in yoru PlayerInteractEvent
how
The cast is the first operation on the null so I'd expect the cast to fail before an npe
ty (jk)
Howeverm, it seems we can cast null to whatever we like
idk how cast works lmao
i mean its null its nothing so u could just give a empty instance of the object maybe thats what it does idk
im dumb idk
No clue, I learnt something today though
i wonder what null really equaLs
You have your drop entity, cast to Projectile and setShooter
its broken ;-;
F5
Thats not even going to compile
public static Arrow ball;
@EventHandler
public void onProjectileHit(ProjectileHitEvent e){
Bukkit.broadcastMessage("test 1");
Arrow ball = (Arrow) e.getEntity();
Bukkit.broadcastMessage("test 2");
if ((e.getEntity().getShooter() instanceof Player)){
return;
} else {
Bukkit.broadcastMessage("test AAAAAAAA");
}
Bukkit.broadcastMessage("test 3");
Player p = (Player) ball.getShooter();
Location aloc = ball.getLocation();
World world = ball.getWorld();
Bukkit.broadcastMessage("test 4");
if(p.getInventory().getItemInMainHand().getItemMeta().getDisplayName().equals("§6§lרובה פארטיקלס")){
Bukkit.broadcastMessage("test 5");
world.spawnParticle(Particle.FLAME, aloc, 20);
} else {
Bukkit.broadcastMessage("8444444444444444444469");
}
}
@EventHandler
public void gun(PlayerInteractEvent event) {
Action action = event.getAction();
Player player = event.getPlayer();
Location loc = player.getLocation();
ball.setShooter(player);
ItemStack item = player.getInventory().getItemInMainHand();
ItemMeta meta = item.getItemMeta();
String name = meta.getDisplayName();
if ((action.equals(Action.RIGHT_CLICK_AIR) || action.equals(Action.RIGHT_CLICK_BLOCK)) && name.equals("§6§lרובה פארטיקלס")) {
new ItemStack(item.getType(), 1);
final Entity drop = loc.getWorld().spawnEntity(loc, EntityType.ARROW);
drop.setVelocity(loc.getDirection().multiply(2));
}
}
}```
?paste
impossible, you added ball at line 50. ball doesn;t exist there
you're casting before checking
LOL
I told you twice already. When you spawn your Arrow it gives you back the Entity. Cast drop to Projectile and setShooter
Hey so Im getting errors, anyone know why? It says its on line 32 but i dont know whats wrong With it
Error- https://paste.md-5.net/behiqariju.bash
Code- https://paste.md-5.net/acoxolejel.java
if (player.getInventory().getHelmet().getType() !=Material.AIR) {
something on this line is null
hmm
rack your brain a bit and see what it is
i dont have a brain 😔
ur getting a null pointer error
lmao
So nullcheck?
Me too
aaah sorry im new to development for spigot.
idk if this is a thing player.getInventory().getHelmet().getType()
All im trying to do is check if someone has an item in their helmet slot
if they do they get the message, if they dont it does the thing below.
bukkit is incredibly inconsistent with whether it returns air or null for empty slots
you will save yourself a ton of headache if you just nullcheck and check for air every time
if (item == null || item.getType() == Material.AIR)
i want to die
so if (player.getInventory().getItemInMainHand().getType() == null) {
Oh wait
scrap that.
bukkit: inconsistent between empty slots (null or air)
me: Bukkit just choose one lmao
lmao
bruh how to cast
yeah its either gonna be air or null like nny said
public void Main{
Brain;
Brain.work;
}
?
lmao
yes brin
Material.AIR isnt null its a material
bruh
no i mean add a big check around everything to see if its not null
the issue is that the ItemStack might be null
Bruh
and since you are calling getType on the ItemStack, you know what happens if it's null
hmm
if (item == null || item.getType() == Material.AIR)
someone know how to cancel saturation use when a player regen ? (i cancel the event of FoodLevelChange)
I just put that in?
idk XD
you read that and you figure out what it does
and then you apply that understanding into your own code
like your name
here we are checking whether ite itemstack we're working with is null
i dont know if you can but Just set the saturation
if it is, we know that we can't do anything with it
if it isn't, we proceed to check whether its type is air
@granite stirrup help me
even if i set it there still a change made by something but don't know what
if either is true we can return or whatever
set it to 10?
nop i wanna decrease it but by my self. Just something touching it and i don't know what and don't know how to cancel this unknow change
class Main {
public static void main(String args[])
{
Brain brain = new Brain(Ages.teen,BrainStatus.decreased);
brain.start();
}
}```
better
f
all caps oof
nOW HELp Me
no one know about this mystical stuff that decrease saturation with a canceled event ?
fork the serbur and throw a stack trace every time saturation is modified
.
is that a reply
but there is no error
well how can i show you this stack trace ?
to know what is being called and by whom
you fork the server and modify the setter of the player's saturation to print the stack trace whenever it's called
heuuuuuuuu
plz some one tell me HOW TO cast?
or learn to google
AaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAaAa
don't have enought talent for doing this
((Projectile) drop).setShooter(playerhere)
spoooon
He wasn;t going to get it himself
then he wasn't ready
He got frustrated enough to remember for next time though
what is the drop
hoo common
oh my
he won't get anything himself because he refuses to use his brain or google anything
he's just sitting here like a sponge and waiting for people to drip everything into his mouth
one spoonful at a time
what do you think drop could be?
drop
sounds similar doesn;t it
maybe
@EventHandler
public void IDK(PlayerInteractEvent event) {
Action action = event.getAction();
Player player = event.getPlayer();
Location loc = player.getLocation();
((Projectile) drop).setShooter(player);
ItemStack item = player.getInventory().getItemInMainHand();
ItemMeta meta = item.getItemMeta();
String name = meta.getDisplayName();
if ((action.equals(Action.RIGHT_CLICK_AIR) || action.equals(Action.RIGHT_CLICK_BLOCK)) && name.equals("§6§lרובה פארטיקלס")) {
new ItemStack(item.getType(), 1);
final Entity drop = loc.getWorld().spawnEntity(loc, EntityType.ARROW);
drop.setVelocity(loc.getDirection().multiply(2));
}
}```
I think you are pulling my leg now
oh f
dude really learn java before saying something here
ok ok
this isn't even an issue of not knowing java anymore
maybe he will learn how to learn by trying to learn java
the issue now is that he doesn't use his head
i don't know if his blood sugar or something is low or what
hahaha
yeah you should go take a break
and come back when you're fit to actually do something and have a legible conversation
and be able to learn from what we tell you
lol
right now you're just wasting everyone's time
sory :(
learn java
lets just say you have all the code you need. Its just in the wrong places
then it will be easier
Text Components right?
Yes
player.spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("This message will be in the Action Bar"));
According to google ^^
Yep
yeah
something Spigot().sendMessage("blah", ACTION_BAR)
that xD
or something close
there is something sad about plastering a bold and all caps DON'T LEAVE on a player's screen
Yeah
the gm+
good
gm+ good
((Player) event.getPlayer()).spigot().sendMessage(ChatMessageType.ACTION_BAR, new TextComponent("This message will be in the Action Bar"));
How do you set the colour
(The casting is because the event returns HumanEntity)
&0-9
theres some letters to but
oh can you not use chat colours?
0-9 and c are the main ones used
u can?
Ok
u can also do hex i think but u need to do ChatColor.of i think
idk
0-9, A-F, lmnkor
Ok
Petition for a ChatColor.Orange
the named color for that is gold
yeah but its not really orange
it's pretty orange
But i want orange
like actual orange
how many times do i have to ping md_5 until he adds it do we reckon
threaten to pr it in paper and he'll do it by tomorrow
too true lmao
tbh if i could work out how the spigot repo works i would pr it myself
i think
Its fine, ill use red
Use minimessages :>
why would u want orange
how would you store data on players?
database
depends on what data
CAUSE its a good COLOUR
or pdc
mongodb or mysql is pretty good i think
nah its ugly
just like their team
pdc for the win
or should i just use /team
i prefer pdc because it's easy and low overhead
"low"
i mean, it depends. Why aren't u using /team
whats pdc
Compared to direct nms access it's trash
compared to a network db request, anything is low overhead
Persistent Data Container
Tho tbhz less PDC fault than itemmeta
There is a spigot guide
idk, i was just wondering if there is a better way
NOPE
at the very least it outperforms disk io and network io
disk is slow tho
and that's good enough for me
True by a long shot
how would you use teams tho?
Pencil and notepad
it does have its fair share of issues though
like not being able to reliably clean out your plugin's data
is there a way to get the player's team's color?
why not just a .db file lmao
True. Cleaning is just rip
if you install 2000 plugins that use pdc and then get rid of them, you'll have 2000 useless pdc entries on your players
You can, you just have to loop over all PDC contents
ah
Yeah get keys could enable it
yeah but you'd have to have a dedicated cleaning plugin for it
a plugin can't clean its own data
Yeah, I alwasy clean up unused PDC data when my plugins finished with it
like, if you're storing something persistently in the long term
a player logs offline and has your data on him
i dont know how to use/what is pdc
what'cha gonna do
;-;
Nothing Xd but like how would that ever work out 😂
i guess you could have some kind of an /uninstall command that loads the playerdata of every player who has ever played and cleans it
but that's a server killer
i mean why cant u just do a .db file on disk
https://www.spigotmc.org/threads/a-guide-to-1-14-persistentdataholder-api.371200/
Happens to be the guy in chat 🙂
yeah chunks and entities are basically impossible
players are like barely manageable
Would be so much effort to clean, you basically just gotta hope the plugin removes temporary ones and live with the permant values
Yea. Gotta know your limits
why not just store a file on disk with every ones team data lmao
Like bigger player data should probably go into a dB XD
lmao
is there a SaturationLevelChangeEvent ?
i think so
?jd
package index
if i cancel foodChangeLevel it don't cancel the saturation change
setting the food level?
But there is foodlevel change event
yep but for Food
And it cancellable
not saturation
Oh
not the same
If your fool level starts going down, you have no saturation
yep but i wanna listend saturationevent
not food
Why do you need saturation?
isnt saturation and food the same
not really
saturation is invisible
food is shown in the bar
it's a weird mechanic that has been basically unchanged since it was introduced in 1.8 beta like 10 years ago
why not use the food one tho
I believe there is a saturation bar
i try to make player regen slow so i make a cooldown to heart regen (2seconds) but in this cooldown the saturation is decresaing and i can't cencel it
small
so the player loose his saturation very fast
saturation can be sort of gauged by looking at how fast the chopsticks jiggle
There is a saturation bar but it is just a hidden stat
i don't remember seeing a bar for it though
do you guys know why this doesnt work?
event.getPlayer().getServer().broadcastMessage(ChatColor.YELLOW + "Yellow bed was broken by " + player + "!");
There is a bar, its tiny though
where is it
is player a string
is it 0 by 0
just above teh hotbar slots
screenshots or it didn't happen
We have all done it
so impossible to control saturation change ?
afaik, yes
i'm not seeing any events for it
paper probs has a way
so how they do haaaaaaaaaaaaaaaaaaaaa
on paper either
code u own one in
i saw a lot of plugin handle this
what i'm trying to dooooooooooo
i'm not seeing a bar
u probs have to make custom saturation idk
i think so
what are you trying to do anyway
i try to make player regen slow so i make a cooldown to heart regen (2seconds) but in this cooldown the saturation is decresaing and i can't cencel it
hes trying to make 1.8 regen
yep something like this
idk
how
you
do it lmao
look through the code of the plugins u found
u might have to recode stuff lmao
That basically isn't possible mate
Sometimes you must accept that things are gone
While every company logo is being oversimplified... Discord scenario is reversed.
Inspired from Memeify!
Check him out:
https://youtube.com/c/Memeify
Hi, I am PepePeepo and i make meme videos daily! These meme videos looks short but i put efforts and spend hours to make them in a cool way.
Subscribe for daily videos and also,
Discord: https:...
You could PR the event to spigot XD
Does it exist on paper ?
i just go jump from my building on the first flrour
if so you could just do a little copy and paste
and md_5 can't moan too much if it is actually paper's code
cause it gives them one less edge over spigot
can i try catch sendpluginmessage? I want to catch the err if i send a player to a offline server, in order to test somethig
2017
yep but that don't change today
"If you wanna cancel the FoodLevelChangeEvent... That would be kinda useless. Because even if you cancel it, saturation and exhaustion still change, which will later on still change the food level by a certain amount. There is just no way to stop saturation and exhaustion from changing without saving the values somewhere and stuff."
it still actual work
maybe i should ping md5 kappa


📎
Nah, maybe just wait till you see him around or wait for choco or some1
im not familiar with the other mods
Or you ask for progress on the issue :)
^^
Kindly bump it and hope someone implements it
i'm trying to set max health of entity. LivingEntity.setMaxHealth is depreciated
can i try catch sendpluginmessage? I want to catch the err if i send a player to a offline server, in order to test somethig
Try reading the docs 😉
Why would you not be able to?
who cares if something is depreciated i mean you probs shouldnt use depreciated stuff but doesnt mean its gonna break anything
The deprecation notice even tells you what method to use instead tho
so like, just use that one ?
Yeah
Its deprecated for a reason in thsi case
attributes
It got replaced
it never says that. What IDE do you use? im using eclipse
?jd
package index
The reason you should ALWASY check the javadocs```
getMaxHealth
@Deprecated
double getMaxHealth()
Deprecated.
use Attribute.GENERIC_MAX_HEALTH.
Gets the maximum health this entity has.
Returns:
Maximum health
ok
?paste
finally
i got it working
https://paste.md-5.net/anojenucov.java found this plugin code but don't understand how he is doing it
from OldCombatMechanics plugin
the code computes how much saturation was lost since the last heal
and grants it back to the player
how would i check if a server is online? (without plugin emssagingif possible but i can use it if its the only way)
Is this from within a Bungee Network?
yes, using a spigot api not bunmgeecord
the serveris in a bungee network but the plugin jar i am using is not bungeecord
why
not use the bungeecord api
ahh makes sense
because i am using spigot api?
it will be easier ;-;
because you cant install bungeecord plugins on a spigot servre?
doesnt the bungeecoord api work on spigot
no
Parts of the bungeecord api are shared
and included in spigot
like the chat api
but that is it
methods like server queries etc cannot be executed on a spigot server
^
i swear u use the bungeecoord api to connect people to different servers
Are you thinking of bungee cord message channels ?
no
Yeah nah, the bungeecord api cannot be used on a spigot server, your memory must be failing you rn
tthats plugin messaging
not bungeecord api
no i swear u use the bungeecoord api if u want to make a server connect you to a different one on the network
dude it doesn't work xD
in a spigot server
You use Plugin messaging to connect people to servers from the Spigot plugin side
do you know how to check if a server is online with idk pluginmessagin maybe?
i swear i have run a bungee api on a spigot server
Then you are a dumbass
Keep swearing on that then xD
As it's impossible.
also, I only know as much as the docs say
you could try however to write a custom bungeecord plugin
¯_(ツ)_/¯
that does that logic for you
Why is this server on a new level of shit today
bro two of the same messages is not spam @queen dragon
dang bot xD
How do I check if a player has a helmet on or an item in there helmet slot?
do you know how to check if a server is online with idk pluginmessagin maybe?
null check the item
reeeeeeeeee
yeah i dont do bungeecord stuff lmao
You can get the armor slot itemstacks and then check if they are air or not, grabbing the Javadoc for it right now.
to complex for me
as I said, if there is no official bungee message for it, write your own bungeecord plugin rhat executes it
Cosmic here's the Javadoc that I referenced https://hub.spigotmc.org/javadocs/spigot/org/bukkit/inventory/PlayerInventory.html#getHelmet()
declaration: package: org.bukkit.inventory, interface: PlayerInventory
On the other topic, you would have to create your own system if you wanted to do it through PMCs, Woulden't be that hard just would need to make a send and receive system that every server has.
redis might fit well
Yeah redis would work good, much faster
what
Does bungeecord even know if servers are online
redisbungee is 20 usd ff
you can implement it yourself lol
And I don't believe Bungee has a check for if servers are online
Not standard bungee atleast
i saw this lmao i its java so i think it will work for u
redis is a database
Yeah, I don't think bungee attempts to ping servers
?
Well, it also has great pub/sub support
^
what does that do
Personally I woulden't use sockets for something that has a ping function callback already implemented
uh it checks the thing on port and ip is online i think idk
isnt that bungeecord only that has that ping function
Yes
hes using spigot api
Oh are you talking about from the Spigot side?
Ah
Yeah sockets are prob one of the easier ways then.
so sockets is probs the easiest way
its probs fine along he doesnt do it every second lol
so using sockets how would i see if its online
Read that thread that was linked
real men just reimplement a pubsub system with sockets
i think s would be null if its offline idk
no link
im using mariadb for sql bt
lmao
Id just recommend you stay away from Thread#sleep
yea ik
it causes a lot of issues
thats why im trying to find a different way to put intervals in between somethign
i was thinking runnables
bukkit scheduler
i think theres a way to delay stuff to happen like every 20 ticks or whatever
or 5 ticks
or 10 seconds
idk
with the bukkit scheduler
i am trying to make a cps check
i need to add a delay between when someone recieves the cps report
Quick question is there anything that would prevent a post request from being sent from a plugin?
cause i dont want it to spam their chat lol
maybe but idk
