#help-development
1 messages Β· Page 1693 of 1
wanted to know if anyone can help before sending it x
throw it in a yaml parser
i have. it still reset
^ paste your yaml
ive pasted it
also when player dies he loses 1 heart of max health
link
then do the opposite on death
-2 ?
yep, is valid
so why is it resetting?
what are you editing?
exactly that. thats my version of the config. ive changed things like the names of groups, changes trues and falses. if its all valid i cant figure out why essentails wont accept it
did you delete anything?
I did something I can shoot water source Blocks with. But sometimes some Blocks are getting replaced although no Block should every be replaced unless its Air. Whats wrong?
https://gist.github.com/ItzJustNico/505a39d9520b9f1506615067b150deac
possibly. things like blacklists with default blocks not to use, ive taken blocks off it
if i send the original, would that help? comparing them?
I see your issue
whats wrong?
how do i fix that?
actually not sure that is the issue
is it worth trying to fix it and seeing if it works? i think i know how to
no it wont be will it. cuz it says moderator, but thats not there either. never was
I guess you are going to have to edit bit by bit, until you see what you are breaking
I see nothing obvious that jumps out at me
i cant either. even in a validator, theres no errors :/
don;t just replace the file. Make changes bit by bit
@eternal oxide
line 44 and 45 adding to startLocation
clone if you don;t want to modify the actual location
got it thank you
Do threads in java generally improve tps when it comes to large tasks?
Or is spigot limited in terms of threading
well you cannot interact with the spigot API in most places while off the main thread
generally, large operations (e.g. database) should be moved onto another thread tho, as long tasks like that prevent the entire server from moving on with ticking
I see, thanks for the info
do I compare locations with == or .equals() ?
hello guys
who's have a good plugin api for particales?
Im using 1.8.8 spigot version
equals
thank you
if (e.getHand() == EquipmentSlot.HAND && e.getHand() == EquipmentSlot.OFF_HAND)
p.sendMessage("ALL_HANDS");
if (e.getHand() == EquipmentSlot.HAND)
p.sendMessage("HAND");
if (e.getHand() == EquipmentSlot.OFF_HAND)
p.sendMessage("OFF_HAND");
why do I write HAND and OFF_HAND instead of ALL_HANDS?
idk, isnt that a question you should be asking yourself?
?
because you have become possessed
His translator is not good. His questions are often wrong
in all seriousness it is because having an ALL_HANDS EquipmentSlot makes no sense
it's meant to represent a single slot
when I click with both hands, I do not write ALL_HANDS
how can I save data in some sort of 'tag' in an entity so when it is killed I can access that data
if (e.getHand() == EquipmentSlot.HAND && e.getHand() == EquipmentSlot.OFF_HAND) this statement will never be true
You can't click with both hands at the same time. One will trigger first
use || (or) instead
how do I make an item get picked up when I click?
ItemStack itemm = p.getInventory().getItemInMainHand();
ItemStack itemo = p.getInventory().getItemInOffHand();
if (e.getHand() == EquipmentSlot.HAND)
p.sendMessage("HAND");
itemm.setAmount(itemm.getAmount() - 1);
p.getInventory().setItemInMainHand(itemm);
if (e.getHand() == EquipmentSlot.OFF_HAND)
p.sendMessage("OFF_HAND");
itemo.setAmount(itemo.getAmount() - 1);
p.getInventory().setItemInOffHand(itemo);
it works, but if you click with two hands, it takes away in 2 hands
or how can I pick up 1 item in the inventory?
hello i want to make a system where if u type /withdraw health, the max health will deduct by 1 and be stored in bottle.
for example if i type /withdraw health:
it will deduct 1 max health heart and store it in bottle
please help
it works for me with both hands if I approach the blocks at close range
The event gets fired twice
Attribute and AttributeModifier might help you
can you please send me the code pls
My job isn't to code for you
I already showed you how to add and reduce teh player max health attribute
Brain fart, would I use this in PrepareItemCraftEvent to check if the recipe is my custom recipe? event.getRecipe().equals("my recipe")
no i want to store in bottle now
You'd need to check the items individually
Alright
You already know how to make custom items too
I think checking if it was my recipe would break less things
please mam, i am confused
No you are just lazy π¦
As in other plugins that have the same recipe
i swear to myself
You already made an item that if used increased their health
you also know how to reduce their health as you now do it on death
now i want a command though
to store in bottle
would be really great, and mean a lot if u could send me code snippet maam
How can I check per slot in a crafting inventory?
People aren't going to spoon-feed you
Slot 0 is the result and slots 1-9 are the crafting grid I believe
Thanks
how can i get the player who spawned the entity
Spawn egg? Or
no, a custom entity spawned by breaking a block
Well if it's custom
whenever the entity spawns, make it do shiz
If you are controlling the spawn of it, you can do whatever
private static void heartwithdraw() { ItemStack item = new ItemStack(Material.EXPERIENCE_BOTTLE, 1); ItemMeta meta = item.getItemMeta(); meta.setDisplayName(ChatColor.RED + "Bottle of Heart"); List<String> lore = new ArrayList<>(); lore.add(ChatColor.LIGHT_PURPLE + "Hearts"); meta.setLore(lore); item.setItemMeta(meta); ItemStack heartwithdraw = item; }
i made this but
i cant import it in my another class:
player.getInventory().addItem(ItemManager.);
ItemManager. has no name of my custom item
that's obvious: you made it private, so of course it cannot be seen by your other code
Also it doesn't return the item
Items are immutable, changing their values doesn't change them in the player's inventory. You'd need to return the item and replace the item in the player's inventory with the one you've returned.
Oh, well, correction: The metadata of an item is immutable (as in it doesn't change the item's meta in the player's inventory).
you mean metadata right?
hence setItemMeta
how can i refactor to nothing in InteliJ
`import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import smp.heart.heartsmp.items.ItemManager;
public class withdraw implements Listener {
@EventHandler
public void onWithdraw(PlayerInteractEvent event){
if(event.getAction() == Action.RIGHT_CLICK_AIR){
if(event.getItem() != null){
if(event.getItem().getItemMeta().equals(ItemManager.heartwithdraw.getItemMeta())){
Player player = event.getPlayer();
AttributeInstance attrib = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
attrib.setBaseValue(attrib.getValue() - 2);
}
}
}
}
}`
i managed to pull out till here, now atleast can u help me in how to store those max hearts in bottle?
if you don't have a return it will probably error and then you can do alt+enter and it should offer changing to void
yes
i just want to rename this whole mess to just skeleton.blahBlahBlah
dear god
find and replace then?
But readability 
But yes Find and Replace is what you want
eclipse (and likely any other IDE) have refactor support for mass editing things like these
@hasty prawn
Use PDC to determine how many hearts the bottle should hold, then when you want to apply it just read from that.
PDC?
i want 1 bottle = 1 heart
pls tell me the code to store it
There's nothing to store if 1 bottle = 1 heart.
how to do it still
When they drink the bottle just modify their attributes.
did i apply drink the bottle mechanism to /withdraw mechanism above?
I don't know, did you?
check the above code and tell pleaseee
I mean based on what you sent you haven't done anything with a /withdraw command.
so i will have to add
AttributeInstance attrib = player.getAttribute(Attribute.GENERIC_MAX_HEALTH); attrib.setBaseValue(attrib.getValue() - 2); in withdraw command class
not in event handler
Yes
also
if players has only 1 heart
how do i stop them from withdrawing hearts?
@hasty prawn
Well you just wrote pseudocode for it. Now do it in actual code.
I'm not going to write the plugin for you.
sorry but u r the author of the plugin so I suggest u to write the code
i just wanted small help -.-
asking help is good and fine, but asking code is not
We are helping, but we're still not going to write the plugin for you.
we explain logic u code
You have everything you need. You just need to put it together.
Doesn't work for all beginners. Some people need code examples before they can fully understand concepts (I'm one of those people since I'm self-taught).
But in this situation, I think Frolic would be better off just coding it himself.
Looking at code is certainly a way to learn but if you constantly just ask for code, you're not learning anything.
I agree, but thats for beginners
now I think about it I read ppl codes as well π , (github codes)
It means it's deprecated.
You are meant to use getAtrribute now
whats the soultion
y are u asking us that when u wrote this ?
Did u copy this from somewhere and not try to understand ?
You already get teh max health attribute. just check its .value() is greater than 2
I feel like i m being toxic rn, I will be taking my leave from this conversation
How do i check something every tick? For example a users vault balance
?scheduling
How would I use packets for a vehicle
I just need a basic rundown of what I would need to do, I can figure the rest out
Funny
im just being honest ;p
I have googled
ok
steering packets I believe
suggestion use head on armorstand for steering wheel
steer left, rotate the armorstand left
very good ππΏ
Ye thatβs what Iβm gonna do, but how do I make the player ride the armor stand, would I have to put an invisible Minecraft on top?
agree
bruh
.addPassenger()
Bet
I mean
I could have looked that up
And steering packet just looks for what button is presssed?
Iβll look that up too
π
Hey, does anyone know how to use an internal module as a maven plugin
which doesn't use the pluginRepositories repo specified in a pom
Yes
everything in the spigot api is ticks
Hello, I have a problem, I changed a player skin using some nms code and packets, that works on localhost but when I move to the real server under bungee code the skins aren't changed. (I have skinrestorer installed on both localhost and server). Have anyone ever dealt with that?
i dont think there's one method where its by second, it would make no sense because the server relies on the tps
[22:44:21] [Server thread/INFO]: Frolic_gamers issued server command: /heartwithdraw [22:44:21] [Server thread/ERROR]: null org.bukkit.command.CommandException: Unhandled exception executing command 'heartwithdraw' in plugin HeartSMP v1.0F at org.bukkit.command.PluginCommand.execute(PluginCommand.java:47) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at org.bukkit.command.SimpleCommandMap.dispatch(SimpleCommandMap.java:149) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at org.bukkit.craftbukkit.v1_17_R1.CraftServer.dispatchCommand(CraftServer.java:776) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at
error in executing command
pls help
ππΏ
send code
`package smp.heart.heartsmp.commands;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import smp.heart.heartsmp.items.ItemManager;
public class withdraw implements CommandExecutor {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!(sender instanceof Player)) {
sender.sendMessage("This commmand can be executed only by Players");
return true;
} else {
Player player = (Player) sender;
if (command.getName().equalsIgnoreCase("heartwithdraw")) {
if (player.getAttribute(Attribute.GENERIC_MAX_HEALTH).getDefaultValue() < 2) {
player.sendMessage("&c&lYou don't have enough hearts");
} else {
player.getInventory().addItem(ItemManager.heartwithdraw);
AttributeInstance attrib = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
attrib.setBaseValue(attrib.getValue() - 2);
}
}
return true;
}
}`
}
?paste
k
send full error aswell
your heartwithdraw is null giving you an NPE
show where you initialize it
`public final class HeartSMP extends JavaPlugin {
@Override
public void onEnable() {
ItemManager.init();
getCommand("giveheart").setExecutor(new ItemCommands());
getCommand("giveheartfragment").setExecutor(new FragmentCommand());
getCommand("heartwithdraw").setExecutor(new withdraw());
getServer().getPluginManager().registerEvents(new Heart(), this);
getServer().getPluginManager().registerEvents(new Killevent(), this);
getServer().getPluginManager().registerEvents(new smp.heart.heartsmp.events.withdraw(), this);
System.out.println("Heart SMP plugin Enabled!!!");`
show init method
How would yall go about to make a event manager?
wym?
a class that handles events for you
i still dont understand
wh
just make methods that run off that event
which?
but its a custom event...
static void handle(Event e){
oh idk πͺπͺπͺ
Someone help pls
bruh we're trying
kk
and ur not helping us to help you give you help with stuff you need help with
like
pls allow me to help you to help me to assist you in this
why are you
using the entire class path
idk its not taking simple name
not working with spigot btw
you only need to register the class that handles events
dosent work
it comes in red
incompatible types: smp.heart.heartsmp.commands.withdraw cannot be converted to org.bukkit.event.Listener
if i type actual name
this error comes
does it implement Listener
._.
yes
`Package smp.heart.heartsmp.events;
import org.bukkit.attribute.Attribute;
import org.bukkit.attribute.AttributeInstance;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.block.Action;
import org.bukkit.event.player.PlayerInteractEvent;
import smp.heart.heartsmp.items.ItemManager;
public class withdraw implements Listener {
@EventHandler
public void onWithdraw(PlayerInteractEvent event){
if(event.getAction() == Action.RIGHT_CLICK_AIR){
if(event.getItem() != null){
if(event.getItem().getItemMeta().equals(ItemManager.heartwithdraw.getItemMeta())){
Player player = event.getPlayer();
AttributeInstance attrib = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
attrib.setBaseValue(attrib.getValue() + 2);
event.getItem().setAmount(event.getItem().getAmount() - 1);
}
}
}
}
}`
this is the code
wtf
why are you using one event per class
holy christ
you're literally gonna have hundreds of classes
and try the class name.
and make it proper case
public class Withdraw
new Withdraw()
etx
`package smp.heart.heartsmp;
import org.bukkit.plugin.java.JavaPlugin;
import smp.heart.heartsmp.commands.FragmentCommand;
import smp.heart.heartsmp.commands.ItemCommands;
import smp.heart.heartsmp.commands.withdraw;
import smp.heart.heartsmp.events.Heart;
import smp.heart.heartsmp.events.Killevent;
import smp.heart.heartsmp.items.ItemManager;
public final class HeartSMP extends JavaPlugin {
@Override
public void onEnable() {
ItemManager.init();
getCommand("giveheart").setExecutor(new ItemCommands());
getCommand("giveheartfragment").setExecutor(new FragmentCommand());
getCommand("heartwithdraw").setExecutor(new withdraw());
getServer().getPluginManager().registerEvents(new Heart(), this);
getServer().getPluginManager().registerEvents(new Killevent(), this);
getServer().getPluginManager().registerEvents(new , this);
System.out.println("Heart SMP plugin Enabled!!!");
// Plugin startup logic
}`
i cant put WithdrawEvents in here
still
πͺ π³π§»
you arent even calling the class
learn Spigot PLEASE
like, this is basic Java && Spigot stuff right
you arent
you're calling a 'new withdraw()'
thats what
not a new WithdrawEvents() lmaoo
i cant put my class name
bruh
its in red
tbh
?learnjava
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
im debating just sending him beginning
yes
please
that all of that
π π π
I'm not
hello
but knowing the fundamental syntax of Java is a prerequisite for making spigot plugins
guys Im trying to create particale
Im using 1.8.8 version
do anyone have a easy way to do that?
There are probably a bunch of third party APIs
IIRC 1.18 was before the methods were added to spigot api
1.8.8 is VERY old (6-7 years) so these answers will be found using Google.
But it is the most used
But the pvp is the best
no its not
It's only 6 years old, but the point still stands, you won't really get much support here for it.
I don't pvp so I don't care π
Imagine running pvp gamemodes in 1.17.1
xd
Well what do you recommend me to do?
you can literally adjust the pvp in 1.17.1 to make it identical to 1.8.8 apart from block hitting but shields replace it much better imo
Guys sorry i dont have time
Im gonna go config 1.17.1 bedwars
And hope for 5+ players
π₯²
hes thinking that us telling him what to do is us making fun of him
I used ocm and no one liked it
Use packets
Google it
yeah ocm isnt the best, like its fine for what it does but surely misses some features imo
yes because getTo() might return null
well you could null check getTo() and then getBlock()
also create a variable for getTo()'s return to capture the instance
I don't think getBlock can be null
hey guys, I have a custom skeleton and entity damage by entity event and im trying to detect if the attacker is the custom skeleton in question, this is what I got so far
}else if(e.getDamager() instanceof Arrow) {
Arrow arrow = (Arrow) e.getDamager();
if(arrow.getShooter() instanceof Skeleton) { //this if gets checked
EntitySkeleton skeleton = ( (CraftSkeleton) arrow.getShooter() ).getHandle();
if(skeleton instanceof UndeadArcher) {
System.out.println("ossos nao mortos"); //this print doesnt get printed out
UndeadArcher attacker = (UndeadArcher) skeleton;
damage = attacker.attack() * 100 / (victimStats.get("armor") + 100);
}
}
}```
is this minecraft 1.17?
1.16.2
ah ok
I did this with a custom zombie and it works nicely
}else if(e.getDamager() instanceof Zombie) { //se o atacante e zombie
EntityZombie zombie = ((CraftZombie)e.getDamager()).getHandle();
if(zombie instanceof Undead) {
Undead attacker = (Undead) zombie;
damage = attacker.attack() * 100 / (victimStats.get("armor") + 100);
}
}```
no way
no way its 10 years old
yeah, its 6 or 7
yea
Its so old that support was dropped almost half a decade ago. And even that was a late decision.
Fixed. no evidence of my crime

Not even close.
1.7 π©
Not even close to being "even close"
i'm tryna use protocolLib to modify the tablist, but i don't get how i'm supposed to get the different fields. I'm pretty sure i need to use packet.getPlayerInfoAction().getfields() but i don't understand what comes next
can someone help?
To be fair though, that is not entirely representative
Im not too fond of the 1.17 update
It only counts servers and there are a lot of small servers on the newest versions, people playing with friends, test servers etc.
i (personally) would stay on 16 unless im modding
Whereas big servers are only counted once
nice help channel\
With that said though, I fully support the movement to the latest version
nice question
serious?
ask!
oh true
i forgor
bump
all you did is show some code. You've not asked a question nor stated any issues you are having
well kind of complicated, the player info packet is a mess
I was trying to get the handle of the custom skeleton class
it worked for the other custom class that I sent below
so how do I do it?
What version are you on?
1.16.2
it worked for the zombie but since the attacker on a skeleton is the arrow, I get the arrow's shooter but for some reason this line "EntitySkeleton skeleton = ( (CraftSkeleton) arrow.getShooter() ).getHandle();" gives me an error
what error
for some reason I cant send prints rn wtf
?paste
!verify
Usage: !verify <forums username>
only verified users can post screens
it tells me to cast to EntitySkeleton or to change type of skeleton to EntitySkeletonAbstract
I tried both, but none of them get recognized when the skeleton shoots
on the zombie one I get no errors, which is why I'm confused
I'm pretty sure craftSkeleton.getHandle() returns EntitySkeletonAbstract and not EntitySkeleton, so that's your syntax error.
But then again, I've gotten so used to NMS in 1.17 π€·ββοΈ
anyone know how I can replace a word in every class with intellij?
like the word test
i want to replace it with hi
but every class that has it
ItemStack item = p.getInventory().getItem(8)
how do I get an item in 8 slots?
Refractor ?
In the 8'th slot?
you can do replace for all files
Just like you're doing
and there you can also filter for "in string instances only"
no
wym kumpel
1 - 8 slots
ctrl shift f?
ctrl+shift+f -> search in all files, ctrl+shift+r -> replace in all files
Loop from 0-8 using a for loop, for each value, get the item.
in the top right you can also change the filter from "anywhere" to "in string literals"
I made a loop. how do I get an item?
Like you did earlier, inventory.getItem(slot)
I got a slot, but how do I get the item itself?
Like you did earlier ^^^
41 slots
for (int i = 0; i < p.getInventory().getSize(); i++) {
ItemStack item = p.getInventory().getItem(i);
Exactly
how do I get an item in these slots?
now worked
not
either I'm a dolboeb or it doesn't work
item.getType().equals(Material.ACACIA_DOOR);
thanks
smells like NPE's but aight π€£
NPE's?
NullPointerException
If any of the slots don't have an item in them
They will be null
And you'll run item.getType from null, causing a NullPointerException
so I got code which prevent player to place itemstack to slot 0
but sometimes if they spam
event is not canceled
which is weird
try to re-download, if the item is in the 0 slot, then this does not work
if you use the cheststealer cheats in the GUI, the items will go to the inventory, but if you try to transfer them or re-upload them to the server, they will disappear
Check is equal enums with == !!
oh
okay
I has a problem forgot about
dragevent
my code was preventing
inventory click event but not drag event
so they were been able to put item
Why did you pinged me
Is Font.PLAIN not a font type?
Hi I'm Trying To Make A Bukkit Plugin My Friend Showed Me How To Write The Code For It But When I Run It It Doesnt Work I Am Trying To Make A Plugin For Upgrading The Tools In Minecraft
Should I Post My Code Here Or Do I Send A Link With The Code Instead? For Like Not Flooding The Chat?
?paste
Ok Thank You
When I Put The File Into The Plugin Folder It Doesnt Show Up In Minecraft
Did you just make a spigot plugin in c++?
ha
Im Not Sure
how are you not sure
What Is c++
...
the fuck
Ethereal do you know anything about programming
Look at this guys message, he obviously doesn't really know how to code
wut
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
?learnjava
@errant drift make spigot in c++
Is Java The Plugin You Have To Update On Your Computer?
What
huh
wtf
Heβs trolling too hard
π
Whats going on
java is a programming language
I donβt get pranked π
thats definitely a troll
this can't be real
ikr
π€
weird
Thanks for the entertainment
?learnjava no check out these links
Here are some links to get you started on learning Java:
- https://www.codecademy.com/learn/learn-java
- https://www.sololearn.com/learning/1068
- https://www.learnjavaonline.org/
- https://programmingbydoing.com/
- https://docs.oracle.com/javase/tutorial/java/index.html
The last one is the only official one, however some of those concepts assume that you already know a bit about programming.
they left
?learnC++
mann
Lmaoooo

LOL
#include "ItemStack.h"
#include "EventHandler.h"
#include "Action.h"
class itemupGrader : public Listener {
private:
int i_lev;
std::string s_nm;
float f_exprence;
public:
itemUpGrader();
void upg(const Bukkit::PlayerInteractEvent& ev);
};
itemUpGrader::itemUpGrader() {
i_lev = 0;
s_nm = "Beginer";
f_exprence = 0.0f;
}
void itemupGrader::upg(const Bukkit::PlayerInteractEvent& ev) {
if (ev.getAction() == Action.Right_Click_Air || ev.getAction() == Action.Right_Click_Block) {
Bukkit::ItemStack* i = ev.getItem();
if (i->getType() == Material.Diamond_Pickaxe) {
//upGrade...
}
}
}
lol
look at his or her code
lol
can we get that pinned
π
yes
say "This is what NOT to do"
haha my name on minecraft is now Player649
#include<JavaPlugin.h>
class MyPlugin : public JavaPlugin {
public:
virtual void on_enable() final {
this -> get_logger().info("Hey!");
}
}
yes
we must make spigot in c++
it would be sexy
hmm I dont have the authority to pin messages on my own behalf
It would be funny
Optic wake up
hes online
How many times does 4 go int o4
0
once
its too big
your too big
π€’
That hurt me
How NOT to roast
whats going on why do i see c++ code
not even gonna say it now
don't worry about it
ikr
@quaint mantle why did the chicken cross the road ||this is an off topic roast||
||to get to the idiot's house||
Knock Knock
π€’
its alrdy too late
you have been judged
in the EntityDamageByEntityEvent event how would I detect if the entity it was damaged by has a PDC?
||this is like my 5th time asking in different wording||
pdc?
Persistant Data Container
EntityDamageByEntityEvent::getEntity
PersistentDataHolder::getPersistentDataContainer
PersistentDataContainer::has
maybe it EntityDamageByEntityEvent::getDamaged idr
also, what method would I use to get the entity that was damaged?
^^
u can look this up on spigot api docs btw
?jd-s
It's just getEntity
thx
unfortunately its in java and not x86 assembly
Does CafeBabe have a search feature to return the javadoc of a queried term/phrase?
wat
_Pesto nope sadly not
:/
I have suggested to spigot that they should add docdex
idk if thats a joke or not but i laughed
lol
Just hope that one day they add it
π₯²
unlikely
hence, hope
I guess I'm dumb because I didn't have any of this in my EntityDamageByEntityEvent lol java , Entity damager, Entity damagee, EntityDamageEvent.DamageCause cause, double damage
I mean something simple like ?jd-s EntityDamageEvent
would I use cause for the damager or actually damager?
Then just an embed with a link
ye pesto
Can't be that bad can it?
it can
was thinking of smtng else but no wouldnt
^
prob damager right?
still dumb
Idk
Read the javadoc mate, your answers are in there
^
_Pesto in the long run I hope I can get the chance to recode CafeBabe using discord.js or something since discord.py or whatever it was called was discontinued.
and if im correct cafebabe runs on that rn
Wait was it? I thought they were going through another update
oh, well from what I understood the maintainer really just couldn't maintain it anymore and any other maintainers didn't want to take over the project.
I got him blocked so didn't saw his messages
yup
getDamager isn't a method in EntityDamageByEntityEvent for some reason
I am waiting for an answer
what version r u using
1.17.1
should be a valid instance method
i'm doing damagee.getDamager and it says it isn't a method
ofc
getDamager cannot be resolved or is not a field
should be event.getDamager()
ok, no worries
question, in the docs they do Entity damager does this actually return the damager, because if it does my last question is unnecessary
and as u know methods always end with ()
i mean EntityDamageByEntityEventβ(Entity damager, Entity damagee, EntityDamageEvent.DamageCause cause, double damage)
lol
thats the constructor
yeah ik
you dont use that to figure out the methods tho
does Entity damager return the damager?
no thats a param lol
k
u cant even access that parameter variable
so I should delete is because it is unnecassary
idk what you're doing but obviously not on the right track
yes
but thats to construct a new instance of the class
which is done for you
you only consume that instance with your event handler method/callback
pog
everything just clicked with the docs
so all I need is this? EntityDamageByEntityEvent event
yes
cool
then all the methods listed there is usable by calling it from your event variable
yay
so I'm guessing this would work so I don't have to use event.getDamager every time Entity damager = event.getDamager(); I don't see why it wouldn't
yes
yay
yay I'm getting better at java and spigot API
yup
sorry

so if I'm doing ```java
if(damager.getPersistentDataContainer(key, PersistentDataType.BYTE, (byte)1)) {
}``` could I just make a new variable for the key in the event?
uh sure
the uh is throwing me off, am I doing something wrong?
how?
you declare a variable outside your method
got it
usually we also have those variables directly under the
public class Blah ... {
its showing me this error when I hover over getPersistentDataContainer The method getPersistentDataContainer() in the type PersistentDataHolder is not applicable for the arguments (NamespacedKey, PersistentDataType<Byte,Byte>, byte)
wait nvm
me being dumb
lol
ofc
fixed
wait no
not fixed
uhh
if(damager.getPersistentDataContainer(key, PersistentDataType.BYTE)) {
}
this is my method
@ivory sleet
yes
help
very incorrect
first of all
I understand like half of this @Nullable <T,βZ> Z getβ(@NotNull NamespacedKey key, @NotNull PersistentDataType<T,βZ> type) Returns the metadata value that is stored on the PersistentDataHolder instance. Type Parameters: T - the generic type of the stored primitive Z - the generic type of the eventually created complex object Parameters: key - the key to look up in the custom tag map type - the type the value must have and will be casted to Returns: the value or null if no value was mapped under the given value Throws: NullPointerException - if the key to look up is null NullPointerException - if the type to cast the found object to is null IllegalArgumentException - if the value exists under the given key, but cannot be access using the given type IllegalArgumentException - if no suitable adapter will be found for the PersistentDataType.getPrimitiveType()
getPersistentDataContainer does not take any arguments
so passing (key, PersistentDataType.BYTE) is not right
?
if(damager.getPersistentDataContainer().has(key, PersistentDataType.BYTE)) {
}```?
correct
the <Z>
would this work
yeah
π
if(damager.getPersistentDataContainer().has(key, PersistentDataType.BYTE)) {
event.setDamage(999999);
}``` so would this work?
It should, in theory
I just don't like starting up my server, it takes 3min and me impatient, but fine
my test server has view distance lowered, end and nether world disabled and some start up /jvm flags to make it bootstrap even faster
I would love that
could you send the server.properties and the /jvm flags in a paste?
?paste
so what is persistent data container
Itβs what it stands for really
and I still don't really know
it is a data container that is persistant
^
Container, containing
Data, containing data
Persistent, data isnβt lost unless the program intended to explicitly erase it
Very useful for storing data with
Works for items, entities, block entities, and chunks
Yes its a very good container for persistent data
I wish ItemStack implemented PersistentDataHolder but yeah
ItemMeta
Yes but thatβs somewhat slow
Lmao yeah maybe
whats something I can use to post a screenshot?
imgur
Imgur
isnt itemmeta mutable too
Yeah it is
Yes as in mutable?
it is mutable
Yeah
But iirc spigot goes through some parsing with strings and what not when using itemmeta thus slow
but itemstack returns a copy for some reason
https://prnt.sc/1slumti this happens when I try to use any of my commands that give me items
send the console errors
immutability prolly
Iβm not entirely sure but I remember Auxilor told me
An api for storing persistent data which uses nbt internally**
inb4 npe instantiation exception
?paste
idk what this means
we need code
Instantiate is when you call new ClassName()
cool
Creating an instance of a class basically
Java 16: π
still no
lmao
it doesnt tell anything about which is the backbone issue (like it tells you what var is null, but you have to look at code to see what could make it null)
but you should still use java 16
lmao
this is the wrong class
Real chads use java 17 π
send PluginCommands
k
you gotta learn to read stack traces
sealed classes are hot
Wait until they add something crazy like string interpolation in java 37
use a switch statement
?
String a = "...";
switch (a) {
case "hi":
// Do something
}
Youβre hot (:
instead of a bunch of if statements
π
ik
I knew it!!!
Null instantiation exception
ItemManager's fields are null
didnt i already help you with this?
send the init method
ik it means ok but I used it as nice
wdym
didnt you use ItemManager.init
what
?
sorry
send itemmanager class
send main class
dude why is it all static
^
because at the time I was following a stupid tutorial because it was my first time writing code for a plugin
This isnt smthing just applied to plugins, its any sort of Java development or even in a more general scope, any OOP language
should I remove all static in the class?
Yes, and turn it into an actual manager class
very stopad
π
π½
now, was static the problem? will it work now?
No, its just bad code that you shouldnt be writing
and it can lead you to solving the issue
(for example, initializing the items inside the constructor instead of a static method)
;o
k
Nope but it will help you on the way, simply just trying to solve the problem at hand without resolving possible enhancements of code and design will lead to badly stretched design of your project ultimately making it unbearable once it expands.
CHEATING ON ME!?!?! WOW

scandals in the minecraft dev community 
how would I initialize it, and in what constructor?
https://drama.essentialsx.net/eyJzZW50ZW5jZSI6MjUsInBlb3BsZSI6WzU3XSwidGhpbmdzIjpbOTNdfQ== @hasty prawn btw
Funnycube quits plugin development. Fans of DataFixerUpper rage.
GTG

I have like 2 min help
now I actually have to go
wtf LOL
π€£
LMAO
lol

Really is a good generator
βTrent removes compatibility between Bungeecord and Bungeecord by request of Chocoβ
π
Bungeecord no longer supports bungeecord 
i can see it
why does spigot use jira π€
βMojang is not updated for the latest version of Minecraftβ
Something about the dmca and github
Hello does i can get all offlineplayers?
i tried Bukkit.getOfflinePlayers() {
not works for me
for (Player players : Bukkit.getOfflinePlayers() {
}
Yes
well ty
I'm looking for an experienced Minecraft server developer for hire and I'm struggling as to where to find one. If you are a developer for hire please let me know! STAFF: If this is not where I should should send this kind of stuff I'm sorry.
?services
If you wish to request or offer development/art/building/administration services, please do so at https://www.spigotmc.org/forums/services-recruitment-v2.54/
Thank you!
k
so
to remove perms from someone its just
PermissionAttachment#setPermission("my permission node here", false);
yes?
Are you managing adding them?
yeah
Hmm
I know you can set them to true false and none with most permission plugins
But none isnβt a Boolean
Is there a removeAttachment
not that i can see
okay so kinda
you have to PermAttachment#setPermission().. for it tow ork
Β―_(γ)_/Β―
it doesnt really matter that much, it works with just setting it to false from what i can see
i'll just p.removeAttachment though XD
AFTEr setting to false
Can armor stands cause a lot of lag. Like if you@plan to make all your mobs with custom models for an MMORPG with model engine, will it lag a lot. Even worse than particles?
how do i run worldborder commands? is there a way? to get size and add to it?
From code?
An armorstand itself should be no worse than a zombie, but if you give them fancy models with items then it can get laggier
Hmm
WorldBorder is the class iirc
oh, thanks good
Would it be possible to do this with a fake entity (entity id only)?
a soy espaΓ±ol
They can help me, I try to respawn an npc but it won't let me say hey the inserted number / id does not look like a number
@white salmon trancudar con https://deepl.com
See why millions translate with DeepL every day. Fast, accurate, and secure β translate texts and full document files instantly. Currently supported languages are: Bulgarian, Chinese, Czech, Danish, Dutch, English, Estonian, Finnish, French, German, Greek, Hungarian, Italian, Japanese, Latvian, Lithuanian, Polish, Portuguese, Romanian, Russian, ...
ademas yo hablo espanol muy poquito
he's saying that he can't spawn an npc
@white salmon muΓ©stranos tu problema a travΓ©s de una imagen
@white salmon ΒΏbuscas el id numeric ode la entidad?
well i need to know if there's any way to change the spawn tick rate or something like that
like difficulties do
disclaimer i suck in java
@EventHandler
public void onPlayerJoin(PlayerJoinEvent e) {
if (firstplayer == true){
System.out.println("test, first player");
Bukkit.getScheduler().runTaskLater(this.plugin, () -> {
// say a message
Bukkit.getServer().broadcastMessage(ChatColor.AQUA + "Welcome and Good luck1 !");
}, 15*20);
Bukkit.getScheduler().runTaskLater(this.plugin, () -> {
// say a message
Bukkit.getServer().broadcastMessage(ChatColor.AQUA + "Welcome and Good luck2 !");
}, 15*20);
}
firstplayer = false;
}
how would i resolve a promise? or whatever so the code luck2 runs 15s after code luck1? is there an easy to to add them? i basically want stuff to happen in predetermined intervals...
i basically want - time - code1 -time -code2 - time - code3 - etc
?scheduling
== true best condition
Hi I'm back
Small question, I created npc with nms. If the npc despawns can I respawn the same npc again ? Currently I save the npc object on db not sure if it's possible to query db to respawn it when needed.
every time I try to run a command that gives me a custom item it shows this error ingame https://prnt.sc/1slumti
?paste
Item is null. Share code π
@shadow tide ^
This is my main class where i am not able to import that event class
`package smp.heart.heartsmp;
import org.bukkit.plugin.java.JavaPlugin;
import smp.heart.heartsmp.commands.FragmentCommand;
import smp.heart.heartsmp.commands.ItemCommands;
import smp.heart.heartsmp.commands.withdraw;
import smp.heart.heartsmp.events.Heart;
import smp.heart.heartsmp.events.Killevent;
import smp.heart.heartsmp.items.ItemManager;
public final class HeartSMP extends JavaPlugin {
@Override
public void onEnable() {
ItemManager.init();
getCommand("giveheart").setExecutor(new ItemCommands());
getCommand("giveheartfragment").setExecutor(new FragmentCommand());
getCommand("heartwithdraw").setExecutor(new withdraw());
getServer().getPluginManager().registerEvents(new Heart(), this);
getServer().getPluginManager().registerEvents(new Killevent(), this);
getServer().getPluginManager().registerEvents(new smp.heart.heartsmp.events.withdraw());
System.out.println("Heart SMP plugin Enabled!!!");
// Plugin startup logic
}
@Override
public void onDisable() {
System.out.println("Heart SMP plugin Disabled!!!");
// Plugin shutdown logic
}
}
`
Please help
i am not able to import Event class to my main class
why
Wdym why?
can you show me your withdraw class?
i want to make sure the package declaration is correct
try adding the this part
sorry discord bugged out, what where you saying



