#help-development
1 messages ยท Page 1694 of 1
getServer().getPluginManager().registerEvents(new withdraw(), this);
also change the name please
from withdraw -> Withdraw
^
Plus also
new withdraw()
and new smp.heart.heartsmp.events.withdraw()
?paste
use unique naming conventions to differentiate from the two classes
Fixed issue ๐
when i try to use my command it says invalid command occured
console output https://paste.md-5.net/aronakezaj.cs
help
Caused by: java.lang.IllegalArgumentException: Item cannot be null same error as mine, yet idk why its null.
same
why ping me
and i bet we have done some silly stoopid error
bc u are the only person ik that may be able to help
its an error that has been solved 20 times today
cool
I havent seen one of them
error
dude the caused by is like the only important part
we know the problem
it solves all of your errors
pls see if there is error in my code
Dudeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
I have TOLD you
ItemManager is not initialized
so what to do
ItemManager.init();
^
in ur main
if its never initialized, how are the items gonna be created?
its initialized already
no it isn't
show your onenable
getCommand("heal").setExecutor(commands);
getCommand("givewand").setExecutor(commands);
getCommand("givefirewand").setExecutor(commands);
getCommand("giveadminwand").setExecutor(commands);
getServer().getPluginManager().registerEvents(new PluginEvents(), this);
getServer().getConsoleSender().sendMessage("Plugin Enabled");
ItemManager.init();```
yes
How
eat 5 apples = u are eating 5 apples
how are you eating apples before you buy them
this is what you're doing with itemmanager
the apples (itemmanager) are being eaten? before being bought
@Override public void onEnable() { ItemManager.init(); getCommand("giveheart").setExecutor(new ItemCommands()); getCommand("giveheartfragment").setExecutor(new FragmentCommand());
in my main class
Right
Who tf am i helping
idk
Cjendantix or you
idk
well it applies to you aswell @shadow tide
help me
yeah
show your itemmanager class
k
problem is with heartwithdraw command
only
I would usually take the advise and listen but i'm tired so don't point me out for bad practice just what I need https://paste.md-5.net/voxiwihaso.java
u copied the code from yt tutorial
didnt u?
lol
?
What youtube tutorial is this its absolute fucking dogshit
and should not be spreading such bad practice
there would be NO errors like this if it were taught correctly
ok pls tell me the error
and how to fix it
not myfault
that sourcecode youtube channel
and kim simpson
Now pls tell the fix of the error
TechnoVision sorry
no
same lol
he has to insult us for bad practice first like Gordon Ramsey
come on call us donkeys
alright
bruh
public class CustomItemManager {
}
lets make a class
no
mr Frolic man
how can he
like
ykw
my brain
im gonna make this github
public class ItemManager { public static ItemStack Heart; public static ItemStack fragment; public static ItemStack heartwithdraw;
i already have
wtf
What's the problem
I can at least see that TechnoVision is a bad f*cking startup and will never watch his videos again
internal error occured while executing command
HE BE TROLLIN SO F*CKING HARD BRO
they dont annoy me
its just the lack of trying to fix and listen
hes talking to @last ledge
oh
nah he is talking to u
2 people, same time, same tutorial, same error
lol
show error?
inecraft_player issued server command: /heartwithdraw [06:56:50] [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 net.minecraft.server.network.PlayerConnection.handleCommand(PlayerConnection.java:1931) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1770) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.server.network.PlayerConnection.a(PlayerConnection.java:1751) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:46) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.network.protocol.game.PacketPlayInChat.a(PacketPlayInChat.java:1) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.network.protocol.PlayerConnectionUtils.lambda$0(PlayerConnectionUtils.java:30) ~[server.jar:3241-Spigot-6c1c1b2-1492826] at net.minecraft.server.TickTask.run(SourceFile:18) ~[server.jar:3241-Spigot-6c1c1b2-1492826]
whoa
ik now dont troll
ok
use ```
i tried everything
LMAO
i tried everything
they cant help you without the full error
What's the line?
scroll down
bruh
Where's the commands class?
heres all my code! now fix it!!!
not really
uh huh
AnkleDev sir, would you please help me fix my small error ?
you're just giving everyone your work and expecting an instant fix
now your just trying to be annoying
What's the issue now?
idk hes expecting an answer instantly after showing his code lmao
I just want a decent tutorial on an item manager, can you redirect me to one? @quaint mantle
im on mobile :(
k
i guess?
to get small help, you need to listen 100 lectures from each person who passess by
lol no
thats developmental help
to get small help you look at the documentation
that too
@last ledge What's the problem with your current code? Don't just say it's not working.
LOL
internal error occured
now I'm going to rewrite my entire item manager like a good boy ||lol||
Don't just say it's not working.
ItemManager.heartwithdraw is null.
It tells you that in the error 
legit
so what can i do
bro
just tell the simple line guys
Make it not be null
ya
how
I had the same problem as him, I would like to know where to change it from null to not, can you please tell me
spoonfeed
By giving it a value
stop trying to butter this people
I don't want code, I just want to know where the value it is talking about is located, because I don't have time to rewrite my item manager riiiiight this second ๐
I love how you are trying to be polite AF, that laughing emote ruined it though
the thing is, i'm not
Pretty sure the goal here isn't to go at each other 
thats just how normal people talk to each other in real life, oh wait, you don't have one
I'm going to stop now because first, I gtg, second that was a bad roast, third, I want to be a decent human being
I'm helping him
Hello, I am presenting an emergency, I need to deactivate the portals that lead to the netehr, disable them, can you help me how to do it
please!
you need to pass class2 to your constructor as the 2nd argument
class2 = new DataSaving(this);
class1 = new KeepHotbarItems(this, class2);```
wrong ping bro
oh whoops, sorry
np
i posted it in that thread
I didn't see it at first, refreshed and saw it
ah yes, i just found it out. imagine this can make me lose my mind for like 3 days....
cuz i fount out my question is so dumb :
(
:
is there a way i can make it follow a player instead of every map entity?
check for the teleport event, compare worlds, cancel event
wait wait wait wait...
java.lang.NullPointerException: Cannot invoke "com.risingrpg.events.KeepHotbarItems.DataSaving.getCustomConfig()" because "this.class2" is null
it seems your KeepHotBarItems is not using the reference you are passing it from the constructor
hm?
It's a bit more complicated
this is programming basics. You really should do some basic learning programs instead of winging it
sorry if that sounded rude. you can start here: https://stackoverflow.com/questions/10159850/java-passing-reference-of-class-to-another-class
?di
Guide to dependency injection: https://www.spigotmc.org/wiki/using-dependency-injection/
i still have no idea...
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.
Hi guys, how do i make this BukkitRunnable always running after got reloaded / server restarted? because it will stopped after plugin reload or server restarting
Start it in your onEnable
the runnable one?
why does it scream at me errors?
its a EntityByEntityDamageEvent
oh wait
nvm even event.getEntity didnt change stuff
๐ถ๏ธ
the spacing o.o
oh no whats wrong again
...
cloudflare firewall moment
ok and?
its ugly
it takes 1 sec to fix anyways
looks like mc code ๐คข
istg spigot devs have the most severe ocd ever
but its my code no?
why so?
anyways
yes anyway very ugly pls fix
send the stacktrace
yes
when i execute one command (/heartwithdraw) it throws internal error occuered error
as well pls
?paste
@minor vapor
yeah I know it got filtered on mine as well lmao, just excluded it
weird
which line is 36 in PlayerHitBow?
yessir
((Player) source ).sendMessage(ChatColor.AQUA + event.getEntity().getName() + " has " + Math.round(( (Player) event.getEntity() ).getHealth()) + " HP!");
and send the entire method pls
the entire if source instanceof player?
the entire event
My all codes are here:
https://paste.md-5.net/lenutarigu.rb
Problem: Not able to use /heartwithdraw command
all things are inside the link
Also, don't initialize your projectile variable on a new line, that can be done on one line like your source variable.
Other than that, try it
okay
@minor vapor
you're adding a null item to the inventory
check my code
Caused by: java.lang.IllegalArgumentException: Item cannot be null
at org.apache.commons.lang.Validate.noNullElements(Validate.java:364) ~[server.jar:3241-Spigot-6c1c1b2-1492826]
at org.bukkit.craftbukkit.v1_17_R1.inventory.CraftInventory.addItem(CraftInventory.java:287) ~[server.jar:3241-Spigot-6c1c1b2-1492826]
i did everything
yes I did
can i maybe try somehow catching the error?
Inside of your ItemManager class, make sure the fields are initialized
still erroring?
yes they are
see i send u all codes
didnt try that thing yet
try it then and lmk
ok
1s
k
Ah, I see
you're using the field heartWithdraw and not invoking your getHeartWithdraw method which never sets the field
therefore it is null
not invoking your getHeartWithdraw method which never sets the field
simply invoke the method
in innit clas?
instead of accessing your heartWithdraw field directly from your ItemManager class, use the method #getHeartWithdraw() instead
that's not a fix
the code like that is working
๐ฆก
its for private use anyways!
still bad practice
yeah, true
two each his own
^
boosters can
oh
meanwhile i added this thing!!!
yes
so i didnt mute it entirely
๐ณ
no but simply throwing a try and catch on a problem to "fix" it isn't a good idea and as said above, it's bad practice
Try catch is used to try a code block and then catch any errors so you know why they are ocurring
^
up, still didn't get it
What does the runnable do
clean up when the plugin shuts down
ie remove that entity thing
there's no way you can let a runnable live if the plugin is shutdown
sure, but cleaning up / just starting it again when the plugin is boot is preferred
as someone uninstalling the plugin will have that artifact left in their world
thats what it will do
well, the entity will need to be removed when the plugin is disabled
but you can re-create it with it's data as Coll said when the plugin starts back up
I mean you donโt need to remove it technically
I suggest creating a temporary data file in your plugins dir for entities cleaned up when the server is stopped
since when can u explain shit
true, you could maybe use entity ids to reference it? But if a plugin is being removed then that entity will still be there
smh
You can get reference with its uuid
well depending on the plugin usage, if it's public and someone say wants to uninstall it, that runnable will no-longer be there when the plugin is disabled, so you'd need to remove the entity
I suppose removing the plugin is a valid concern
yeah
Although ideally a server owner would make sure any entities are already gone
If it comes down to it you can always /kill them
yeah that could work as well
Im trying to execute a command when a certain mob dies. I store the command in the PersistentDataContainer of the mob. How would I be able to give the command input of who killed the mob?
is there any way i can make my custom entity not stop when its near me
the entity is not on nms btw
if(player.isDead()){ Player killer = player.getKiller(); if(player.getKiller() instanceof Player){ AttributeInstance attrib = killer.getAttribute(Attribute.GENERIC_MAX_HEALTH); attrib.setBaseValue(attrib.getValue() + 2); AttributeInstance attribb = player.getAttribute(Attribute.GENERIC_MAX_HEALTH); attribb.setBaseValue(attribb.getValue() - 2); if(player.getMaxHealth()<2){ player.setGameMode(GameMode.SPECTATOR); }
i wanted to make if players dies with less than 2 max health
then his gamemode will be changed to spectator
but its not working
pls help
LivingEntity::getKiller is not an option?
It is but im not sure how to change the command to where it contains the killer.
Actually is there a replace method in string?
Yes there is. Nvm me then
Rainny pls help
https://throw-a-fridge-at.me/CVfIJscSBuQNzFT
pls do this
Player killer = player.getKiller();
if(player.getKiller() instanceof Player){
AttributeInstance attrib = killer.getAttribute(Attribute.GENERIC_MAX_HEALTH);
attrib.setBaseValue(attrib.getValue() + 2);
AttributeInstance attribb = player.getAttribute(Attribute.GENERIC_MAX_HEALTH);
attribb.setBaseValue(attribb.getValue() - 2);
if(player.getMaxHealth()<2){
player.setGameMode(GameMode.SPECTATOR);
}```
there you go
help pls
i wanted to make if players dies with less than 2 max health
then his gamemode will be changed to spectator
but its not working
pls help
no but syntax highlighting
why are you verifin once the attribute then you simply go through player?
you do it right for the killer yet get lazy for the player
wut
player.getMaxHealth() why arent you checking the attribute instead
i am checking right?? player,getMaxHealth()<2
use the attribute instead as its safer
ye try ity
you're getting the attribute and not the value
it's the exact same code
.
why are you sending custompayload when there is specific packets for everything?
or are you messing with custom clients
How do I make a plugin that drops 5 experience orbs when a block is broken?
https://imgur.com/a/HUNqm80
whats the error?
No location
ahh yes
but thats for opening a book not for left clicking?
ahh in that case this wont do it a packet will meerly do the animation
the rod will still be there
wont rly matter
a packet is simply a visual thing
it doesnt have any effect on anything else
but anyway you can try sending the packet and see what happens
this should be the one your looking for https://wiki.vg/Protocol#Use_Item
'spawnEntity(org.bukkit.Location, org.bukkit.entity.EntityType)' in 'org.bukkit.World' cannot be applied to '(org.bukkit.entity.EntityType)'
1sec
I already told you the issue
oh
what version?
You're not putting any info in the animation packet
Oh and if you don't know what you're doing, use Protocollib
Hi
If i want to store a multiple inventories for a player how i can do it?
i was using HashMap <Player, HashMap<InvName, Inventory>>
But idk if is the correct way
hi basically i am try to stop using shade maven plugin due it makes plugin size over 9mb so , so i made way to download thoses libs and check them on plugin loading but issue here i am using some hacky way that works on java 8 but it does not work on java9+ so i tried to make class loader for URLClassLoader, to load the downloaded jar files it loads but when start to use the jar file classes it throws ClassNotFound
PacketDataSerializer dataSerializer = new PacketDataSerializer(Unpooled.buffer());
dataSerializer.a(EnumHand.MAIN_HAND);
PacketPlayInUseItem packet = new PacketPlayInUseItem();
packet.a(dataSerializer);
//send packet
you can try out the spigot feature to automatically download the necessary library dependencies. https://www.spigotmc.org/wiki/plugin-yml/#optional-attributes libraries
damn been so long last i worked with raw packets i forgot how to use protocol vg
ahh think you need a size for the buffer
do 256
@hasty jackal issue is that its 1.16.x only and i want for 1.15.2 or even lower but thanks for the tip
unpooled.buffer(size)
hmm i see
PacketPlayInUseItem packet = new PacketPlayInUseItem();
PacketDataSerializer serializer = new PacketDataSerializer(Unpooled.buffer(0));
try {
packet.b(serializer);
serializer.setByte(0,0);
packet.a(serializer);
} catch (IOException e) {
e.printStackTrace();
}
//send packet
also dont send a second animation packet
only this one and see
Just use Protocollib
Then you might have to figure this out on your own
Then do it the easy way and use Protocollib
You don't need to do everything on your own
Most servers have it installed anyway
alr setted up a 1.16 gonna test it now and see
anyone know how to hide these messages?
de-op yourself
any way to not show them in the console?
no point in hiding them from console
alright, thanks ๐
broadcast-console-to-ops in server.properties
oh so its nothing I have to do when making a plugin. nice ๐
Well seemes that was the wrong packet got one who does the animation
however what exactly are you tring to do?
What about it is not working
The first method is correct
The second method does that
The first doesnโt
Can anyone help me? I'm playing around with threading trying to get the return value
public class TestThread implements Runnable{
public volatile int value;
@Override
public void run() {
value = 2;
}
public int getValue(){
return value;
}
}
However getValue always returns 0 no matter what.
@EventHandler
public void onBreak(BlockBreakEvent event) {
Player player = event.getPlayer();
Thread thread = new Thread(new TestThread());
TestThread testThread = new TestThread();
thread.start();
try {
thread.join();
player.sendMessage("Values from thread" + testThread.getValue());
} catch (InterruptedException exception) {
exception.printStackTrace();
}
}```
you're creating two instances. the first one actually gets executed, the second one does not. and then you're loading the value from the second one. of course it does not have the changed value because it never got started
My levels isn't increasing, anything wrong?
@EventHandler
public void onXPDrop(BlockBreakEvent event) {
Block blockBroken = event.getBlock();
Player p = event.getPlayer();
event.setCancelled(false);
p.getWorld().spawnEntity(blockBroken.getLocation(), EntityType.EXPERIENCE_ORB);
}
Quite sure you need to set the experience level for the orb.
You know there exists a Java framework for concurrency
Like itโs in the jdk
p.getWorld().spawn(blockBroken.getLocation(), ExperienceOrb.class).setExperience(1);
o
worked ty
is it a boolean or string when I type true into a yml folder
Wat
http://prntscr.com/1sooon1 this is a boolean right
yes
Where is the right channel to ask if i cannot get a plugin to work properly on my server?
where can I find protocollib javadocs?
Oh I see, well in that case is there somewhere I can find more about Spigot 1.17 NMS?
is there a way to stop a custom zombie from despawning when there are no players near by? i've tried Entity#setRemoveWhenFarAway(false); however 20 ticks later Entity#isDead() returns true still? I am spawning the zombie a little bit far away but before spawning i'm forcing the chunk to stay loaded with world#setChunkForceLoaded. Would anyone be able to help me out with this?
I have an error https://paste.md-5.net/yozoxixaja.cs, the item is null, yet idk why, so here is my item if u need it https://paste.md-5.net/orimozosat.cs
appreciation post for the people who answer questions and help people! You guys chill here and teach others and even if it benefits you a bit (teaching is the best way to learn) just know I appreciate you sm and so many people's plans would not have been possible without you so many thanks <3
this guy, bro what u said
i dont think your item is whats null
yeah
just looked at the caused by lol
at com.CJendantix.plugin.Plugin.onEnable(Plugin.java:18) ~[?:?]
whats at line 18 in your onEnable class?
getServer().getPluginManager().registerEvents(new PluginEvents(), this); so it has something to do with my events
yeah looks like it
how can I make one stick get into my hand when I click a stick?
if you take it in the left hand, 1 stick will be taken from the left hand, if you take it in the right hand, 1 stick will be taken, if you take it in 2 hands, the left and right hands are used.
how can this be done normally?
you got this from here?
when you register an event don't you have to declare the main and plugin?
it looks like you just have 1 thing set
ok so
ye
got it
Do u use a IDE ?
it made me make a constructor in my class
u dumb? who doesn't
some people don't and it hurts me physically
what's the error you are getting?
.
Good, just want to check of u were getting a syntax error
plugin is null
their line 18 is
getServer().getPluginManager().registerEvents(new PluginEvents(), this);
If u don't might can u send the PluginEvents class ?
send the Plugin class
I'm not that stupid, if I was getting a syntax error, I would know
wait
Just asking
Plugin.plugin() is returning null when you call new PluginEvents()
dont you need a constructor in your class-
to register an event?
no
no
ahhh
lol
Their is a default constructor of u don't have one written
oh interesting didn't know that
@paper geyser what time is it 4 u
nooo
^ can we get the code ?
that means u won't be on at 10 for me, and 9 4 u
i will
oh
bump
I gtg rn
gotta sleep at a normal time today
I think you was thinking of something like this
class Event implements Listener {
public Event(JavaPlugin plugin) {
getServer().getPluginManager().registerEvents(this, plugin);
}
}```
main class?
Bump
He's either never setting the variable he returns or sets it after he tries to register events
EVENT CLASS:
private final Main main;
public EventClass(Main main) {
this.main = main;
}
MAIN CLASS:
Bukkit.getPluginManager().registerEvents(new EventClass(this), this);
But he never gave the class
Definitely should do that instead but I aint trying to tell him how to do stuff, just fixing a problem
As Borlea already said, Plugin.plugin() is returning null cuz u never set the value of plugin field
yeah
as I was saying
and idk why i didn't say this clearer
wait
nvm
shhh
oh
so you're using PlayerFishEvent right?
just do event.gethook.remove
no luck tho,from what i understand it is possible to listen to the event,check state,set item then it should do it
yeah
as the event seem to trigger on fish bite so you can be tricky and play the sound and such
PlayerFishEvent?
yes
nah
it triggers on fish bite
nope
with the state fish_bite
i just tested it a while ago..
yeah however actually forcing pull seems impossible
you could just remove the hook and give the item to the player maybe
you do it through event..
How can I open a custom inventory on a resource pack using Spigot?
as mentioned above through playerfishevent
- do a sudo fishing rod pull up with event.getHook().remove
- figure out how event.getHook.pullHookedEntity() bc apparently it doesnt work
OH
you want to force another player to pull it up?
you could randomly choose it
think loottables are broken in 1.16
ahh
fkd up nms implementation
mmm not quite
i'm not sure if
you can do that through the click event?
It's obviously possible but it requires a completely different approach
when a player fishes you could save the hook in a hashmap
then remove it on left click and give the player the item manually
so
this should do it
@EventHandler
public void fish(PlayerFishEvent event){
Player p = event.getPlayer();
if(event.getState() == PlayerFishEvent.State.BITE){
p.sendMessage("Bite");
ItemStack rod = p.getInventory().getItemInMainHand();
//Add damage to rod??
p.getInventory().setItemInMainHand(null);
Bukkit.getScheduler().runTaskLater(this,()->{
p.getInventory().setItemInMainHand(rod);
},2);
p.playSound(p.getLocation(), Sound.ENTITY_FISHING_BOBBER_RETRIEVE,1f,1f);
p.getWorld().dropItemNaturally(p.getLocation(),new ItemStack(Material.COAL));
}
}
that's not what they're asking I think
what to drop its up to you,doing damage to rod up to you
auto fish
thats what they askin for
from my understanding they want to stop people fishing
that would do autofish so good job! good code homie
(that sounds sarcastic it's not quick thinking is cool)
thats what he wanted..
is it?
I'm so confused-
I feel like i'm coming off rlly passive aggressive so sorry if I am haha
i think we're being friendly? I'm not sure I don't mean to come off aggressive
if I am i'm super sorry
from my understanding they want to make other people stop fishing
so like
when they click on a player it pulls up their rod
wut... you want spear fishing like?
theres a method called pull or something
yeah ok
on fish hooks
so what you want is
sadly doesnt seem to work
apparently it's not working from what i've heard
ok so
why not
and ima head out
aight
declaration: package: org.bukkit.entity, interface: FishHook
@dire marsh not working.. at least for 1.16
ok so toto
what does not working mean
when are you calling it
scrap that
it needs a hooked entity to pull
might be calling it at the wrong time, but if it's actually not working then make a bug report
first you're gonna make an event (PlayerFishEvent) and you're gonna put a hashmap that stores the player and their hook
OH
so they always catch fish?
so they can spam the fishing rod
and catch something
cool
you probably need to impl own logic then...
or well, can't you just set the min/max wait time very low?
and then force a pull
wouldn't that work?
look at those methods
Get the maximum number of ticks one has to wait for a fish biting.
...
Why are you still on 1.15.2
i gave up once i understand himself doesnt know what he wants
Just update your stuff
1.16 nms is fine?
that argument only work if you were on 1.16 and needed to update to 1.17, but even then updating nms between those isn't too hard
No one really uses 1.15
then you are on your own
damn spittin on viaversion/backwards
we have given you the solution, it's up to you to either update and use that or find a way using nms
nms gay
It does work
then pulling when a fish has bitten
bruh
then how can you say "it doesn't work" when you are on 1.15 and haven't tried 1.16
You will need nms
๐คทโโ๏ธ
go find it
^^
you could just save yourself the pain by updating...
what 1.16 item are you talking about
or use via
They can't use new items with via
via will tell the client it's something different
u can its just a plsceholder item
I'm aware. Which is why some won't work correctly
that only plays out the pull fishing rod animation
you have to remove the hook give item or such
as in items that are useable?
I'm pretty sure via would "fix" that
i still dont know what the problem is in the first place lol
Hey, I would like to be sure, does the Location#getChunck automatically loads the chunk ? seems like it does
yes
so does getblock etc
alright thanks !
Have a list of uuids(players that are fishing),add the player in the list if he throws a hook(listen to playerfishevent),listen to interactevent check if its left click,check if the player is in that list,check if he has a fishing rod in the hand,do the swap trick to simulate pulling,play a sound,give fish,remove from list,also you could have a runnable checking if the players in the list still have a fishing rod
does anyone have a resource for NMS pet following
Has anyone here worked with Bluetooth with Java or JS? I'm having issues getting it running. Any library is fine ;/
oh boy good ol pathfinding
do you really need nms for pathfinding
For Spigot yes. Paper no
seems not unless you store the event call and work with it
can't you just use Mob#setTarget
even for paper you still need if its packet based
True
yes
i'm back
it's so cool that people also think that vanilla fishing is weird lol
like
it's not weird just like
also not my favourite fishing system yk?
you know
like
it means "you know"
minecraft's vanilla fishing system
been working on my own for like a week now
almost 2
:0
thats cool
check if the action was left click air then?
do you have torches equipped in your off hand?
I accidentaly deleted jdk 14 from my computer, now my code has errors everywhere. I reinstalled it and it still doesnt work. Please help
You need to specify it in the IDE
change the jdk in your ide
lul
...
<3
thank goodness it worked i was worried for a second
:)
<3
its 2021, nothing works
Attempt to access Class objects for TypeMirrors [ClassName] Maven does not show me the stack trace so idk what's wrong. The problem must be on the new added code:
Register registerAnnotation = element.getAnnotation(Register.class);
boolean continueLoop = false;
for(Class<?> clazz : registerAnnotation.toNotRegister())
{
String className;
try
{
className = clazz.getName();
}
catch(MirroredTypeException e)
{
className = e.getTypeMirror().toString();
}
if(className != null && !processingEnv.getTypeUtils().isSubtype(element.asType(), processingEnv.getElementUtils().getTypeElement(className).asType()))
{
continueLoop = true;
break;
}
}
if(continueLoop)
continue;
does your IDE show the location of the error?
No, only that line
[INFO]
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ DogLeader ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 21 source files to C:\Users\<>\IdeaProjects\DogLeader\target\classes
This is the output
With -e it works fine
what does that flag do again?
Print the full stacktrace
But it does not solve the problem
https://paste.md-5.net/ilunitipej.sql Still don't know what's wrong
Does anyone know how to connect a Hosted Minecraft Server to my Local SQL Database? I want to do this for testing purposes, and I'm also super interested in learning how this is done.
which ip would I use from ipconfig
and which port do I open?
Google what is my ip
See the IP address assigned to your device. Show my IP city, state, and country. What Is An IP Address? IPv4, IPv6, public IP explained.
javax.lang.model.type.MirroredTypesException, at
for(Class<?> clazz : registerAnnotation.toNotRegister())
@Inherited
public @interface Register
{
RegistrationType value();
Class<?>[] toNotRegister() default {};
}
It is possible that the class is not on mavens build path
The class input are all classes which should be compiled
Or if it is, it could be in an altered state (which is the pain of javax.* packages - the JVM could provide them, but so could some random library)
StackOverFlow sais I have to wrap it in the exception, and from the exception I can get the type mirrors
guy pls help i dont get any damge and mobs dont target me just like creative mode in my server iam the only who have this glitch pls help this is annoying
Wrong channel
is this development related?
It's not
He alrdy spammed like hell in there as well
then we know who won't live long
I feel like I'm missing some crucial context here. But why would wrapping it in an Exception change it?
class objects as in?
Which of these ports do I open?
https://imgur.com/a/w7KwvsF
Class<?> or Class<?>[] (I use the last)
That is the default SQL port
there's just 4 things that say "mysqld"
Ah, so you want to get the value of the annotation as a java/lang/Class array?
Yes
yes, that's the porn you open on your router
And then check the classes
port*
shouldn't matter
oke, I'm following this https://www.opendental.com/manual/port3306.html
but the checking the classes thing isn't problematic right now, right?
That is for Defender
It is the problem, Getting the classes throws the exception
o oke, I'll find a different guide
at runtime?
When I call toNotRegister (which should return Class<?>[]) it does not work
No at compiling
Ok it works if I catch the exception
try
{
registerAnnotation.toNotRegister();
}
catch(MirroredTypesException e)
{
types = e.getTypeMirrors();
}
But is seems it still does not ignore the class
Is it supposed to be simple to open port 3306?
okay
In windows CMD do ipconfig and check for Default Gateway, browse that ip and open port 3306
Alright I'll try ๐
@quiet ice do you know a solution? Because catching the exception does nothing
Should I get the default gateway for my Wireless LAN Adapter Wi-Fi, or Ethernet Adapter ZeroTier One
Why can't you do Class#getName() or somethin like that to get the class name?
I tried
I don't really understand why you need to use javax packages for that
I am doing more then only that
The one you are using atm
I also have that problem, sometimes I get randomly teleported somewhere else if I try to get the spawn location
Ugh, the whole Type mirror thing lacks documentations
Yes I also found that out
I can better create a sub annotation which you use to not register classes
is the JVM automatically wrapping the class objects into type mirrors?
Is there a right click and left click event?
PlayerInteractEvent?
nah, there is no event for that. The events are always based on packets
you have left and right click but not seperate events.
such plugins either read packets or listen for things such as EntityDamageEntityEvent and similar
I guess it depends on teh type of auto click you are trying to detect
Like I want to prevent people to click over 45 cps
that being said, there is no "click" packet to speak of
Hmm
You will have to aggregate many packets to make an approximation of what could be the clicks
Uh seems to be hard
?pmc
However if the player is using autoclicker and there are not more packets than without, it is as if there is no autoclicker, so the count of such packets suffices mostly.
The same applies to events
Uh sounds complified
it's not that hard. You just look at the list of events and listen for the events that are caused by a click, then dump it into a central processor method that does the actual logic
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/event/class-use/Event.html (just use the "subclasses of event" - the "uses of event" pane can be ignored) will help here
what method is used by a hashset to check whether an element is already stored? can i override it?
HashSet is just an HashMap so it's #equals(). You cannot override it easily
hi
welcome back ๐
so, where did I leave off?
not sure
err, do you remeber what my question was
your plugin was null right?
yeah
so, here is my event manager if it helps https://paste.md-5.net/cudihemima.cs
@paper geyser
So Plugin.plugin() is null?
? no
What's null then?
at com.CJendantix.plugin.Plugin.onEnable(Plugin.java:18) ~[?:?]
Show your main class then
line 18
variable is null
so
what variable
It is plugin.plugin() that is null
It's probably not initialised when you initialise the listener
NamespacedKey key = new NamespacedKey(Plugin.plugin(), "pdckey"); this line
It's not in your main
On line 18 you're creating a new class named PluginEvents
Or, a new instance of that class.
yes
That throws a NullPointerException, because to create that instance, this line of code is run ^
but Plugin.plugin() is null
So NPE ๐คทโโ๏ธ
Show me your main class if you want me to help you further
Yeah, so you have a variable named plugin which is returned by the method plugin()
But you're never setting it to anything
hence why it's null
so what should I set it to?
this
so private static Plugin plugin = this;?
is the original zombie AI smart enough to utilize jump boost?
nope, it's a static variable
it gets effected by jump boost but won't actively try to use it
You cannot set it like that
But you can do plugin = this at the top of your onEnable method
i mean, if there is a 2 block hole, will it try jumping out?
probably not
ill check for you
btw how did they get an estonian domain
its very hard to get
no clue