#help-archived
1 messages · Page 62 of 1
it should work fine it detects if the sugar cane is present cancells the break event, than does the task sets to air etc
Wait, shouldn't the material be SUGAR_CANE_BLOCK?
does spigot have a built-in way to serialize an itemstack for writing to file/db?
Thankfully the worlds will have everything "random" ish disabled. The only entities that spawn will be off my own design etc.
@turbid latch very wrong
If a World also has a UUID, why don't I just throw it into a hashmap or something like that?
Then I could grab the UUID of the world in the event or something, compare it to the hashmap and IF the boolean in the hashmap for that UUID key is true, it will play the sound.
You should use the item consume event.
how to check for consume item then?
We told you already...
i never use consumeevent
Read the docs.
Is there any reason there would be no colour to an actionbar created by an NMS json string which does include colour
something else is preventing the code from runninng i fixed that simple issue still not working
Ha, it was so:
event.getBlock().getWorld().getUID();
Big thanks @radiant pollen , now I only need an if to check a hashmap for the UID and if it's stored in there, it plays the sound.
Nope, it's a typo itself in the api apperently.
@radiant pollen sorry for the confusion and thanks for info👍
Hey guys, any another way to detect Mouse middle clicks (if its possible) on InventoryClickEvent instead of if (event.getAction() == InventoryAction.CLONE_STACK) because you need to be in creative to perform that.
I don't think, but you could try sending a specific packet to the player that makes client think they're creative while they aren't (like hypixel limbo does, you can middle click blocks to get them, not sure if same applies to inventory click)
who have a rank plugin ? (i don't wan't <RANK USERNAME> MESSAGE (like luckperm) i wan't a full customizable)
Hey, little question, in the /msg <target> <message>, how do I get the <target>, without using getRecipients(), since its depricated. on a PlayerCommandPreprocessEvent
true, but it might be removed in a future version though
what version are you using
1.15
1.15.2?
yes
I use getRecipients so I'm not sure how else you would do it
okay, will just use it then 😄 seems there's no real alternative
I'm relatively new to spigot and java but I was just look around and came across PlayerChatEvent didnt really look into it so idk how useful it is
I dont think PlayerChatEvent fires on commands
@hallow surge Add debug messages before every conditional statement you have and see where it stops.
okay new to java how do i use the debug message
Just print a message to the player or in the console.
what am i exactly printing
Just a message. "Test1" and then print "Test2" somewhere else
Before each if statement basically
oh okay
Do one at the top of the event before you do anything to make sure the event is firing at all, etc etc.
its so dum
lmao wtf are you doing
I know exactly which code causes it
@radiant pollen my mind is broken
it runs every single test i put into myc ode
@EventHandler
public void onSugarCane(BlockBreakEvent e) {
Player p = e.getPlayer();
p.sendMessage("test");
Block block = e.getBlock();
if (block.getType() == Material.SUGAR_CANE_BLOCK) {
p.sendMessage("test1");
e.setCancelled(true);
Bukkit.getScheduler().runTaskLater(plugin, () -> {
p.sendMessage("test2");
int canes = 0;
Block b = e.getBlock();
do {
p.sendMessage("test3");
b.setType(Material.AIR);
b = b.getRelative(BlockFace.UP, 1);
canes++;
} while (b.getType() == Material.SUGAR_CANE_BLOCK);
p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
p.sendMessage("test4");
}, 1L);
}
}
}```
all 5 of them it runs
But the items aren't given to the player?
no
and the items still drop?
they just drop on the floor
the only other code to deal with scane is this
@EventHandler
public void blockPlaced(BlockPlaceEvent event) {
Block b = event.getBlock();
Player p = event.getPlayer();
Material m = b.getType();
b.setMetadata("placedbyplayer", new FixedMetadataValue(this.plugin, "something"));
if(m == Material.SUGAR_CANE_BLOCK) {
if(b.getRelative(BlockFace.DOWN).getType() == Material.SUGAR_CANE_BLOCK) {
event.setCancelled(true);
p.sendMessage(ChatColor.RED + "You can't place that their wait for it to grow");
b.removeMetadata("placedbyplayer", plugin);
}else {
event.setCancelled(false);
}
}``` and its a place event not break
oh wait @radiant pollen it gives sugarcane to the inv now
just the block you break though not the blocks above it
Move p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes)); to inside the do-while loop.
still having the issue i quoted above
oh wait it gives sugarcane to the inv now
You could try, inside the do-while loop, b.getDrops().clear()
Before you set it to air.
Did you move the addItem() to inside the do-while loop?
yes
Right now, it's after the loop so it only gives one.
do {
p.sendMessage("test3");
b.setType(Material.AIR);
b = b.getRelative(BlockFace.UP, 1);
canes++;
p.getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
} while (b.getType() == Material.SUGAR_CANE_BLOCK);
p.sendMessage("test4");```
Oh wait... hmmm.
Nevermind, you were changing the amount.
It's weird that it only drops one.
It's probably because the top blocks are getting broken automatically
get drops is returing a new list everytime
drops one and doesnt even delete the scane on top breaks and drops a sugarcane piece
So the blocks above the bottom sugarcane are already air.
You might have to break them from top to bottom or cancel the Physics event that's making them break.
I tried cancelling the physics event but it always ended up in just weird situations
and didnt fix hte problem
for some reason my plugin jar file is now 4 MB when the previous release 30KB and I haven't added much code to it
Then break the blocks from top to bottom.
@pastel condor You're probably shading something.
isnt that what its doing already
like what?
No, you're breaking the bottom block first and then getting the block above it and checking if it's sugarcane and breaking it again.
like the whole minecraft api?
You should loop and go up and check if it's sugarcane and then break all the blocks once you're done checking how tall the sugarcane is.
@pastel condor You're shading a dependency or something.
@tiny dagger no its not a loop
@Override
public ServerChunkCache getChunkSource() {
return (ServerChunkCache) super.getChunkSource();
}
thats the method that causes it
this looks weird, any idea how it worked?
@radiant pollen shouldnt this code work?
@EventHandler
public void onSugarCane(BlockBreakEvent e) {
Block block = e.getBlock();
if (block.getType() == Material.SUGAR_CANE) {
int canes = 0;
e.setCancelled(true);
do {
block.setType(Material.AIR);
block = block.getRelative(BlockFace.UP, 1);
canes++;
} while (block.getType() == Material.SUGAR_CANE);
e.getPlayer().getInventory().addItem(new ItemStack(Material.SUGAR_CANE, canes));
}
}```
even if I rename the method and remove override it NPEs
@hallow surge Try adding the blocks to a list and then set all the blocks in the list to air after the first do-while loop.
eclipse has a bug where if i try to put an enum inside an enum sometimes it would freeze
Any preferred method for Custom Items that have "passive" abilities in a player's inventory being used?
Should these abilities be checked using a Task, or would it be far more optimized in an event?
What event are you thinking about using? @vivid herald ?
Events related to the ability use, such as if the item has Regeneration +25%, the EntityRegainHealthEvent is used.
look into itemStacks like when in hand
p.setFoodLevel(20);
^ just as an example for my /feed command
@vivid herald If you can use an event, use an event.
Oh, I'm not checking if it's in the player's hand. Just if the item exists in the inventory, get the ability from the item, and run the ability.
same goes for inventory iirc
I imagine you'll have some passive abilities that are not necessarily associated with an event. I don't think a task would be too taxing on the server.
Then would it be better to just run a general task that checks the inventory, and runs the ability?
Well I would still prioritize events if you can.
I just do it the way I do because its in an inventory prolly better ways to do for passive abilities
@radiant pollen any idea why if statements dont like to run after
b.setType(Material.AIR);
Can you show the code?
just looking back at another itteration of the same type of idea i had
@EventHandler
public void onSugarCane(BlockBreakEvent e) {
Player p = e.getPlayer();
p.sendMessage("test");
Block b = e.getBlock();
b.getRelative(BlockFace.UP, 1);
b.setType(Material.AIR);
b.getRelative(BlockFace.SELF);
b.setType(Material.AIR);
p.sendMessage("test");
if (b.getType() == Material.SUGAR_CANE_BLOCK) {
p.sendMessage("test1");
if(b.getRelative(BlockFace.UP, 1).getType() == Material.SUGAR_CANE_BLOCK) {
e.getPlayer().getInventory().addItem(new ItemStack(Material.SUGAR_CANE));
p.sendMessage(ChatColor.DARK_GREEN + "+1");
if(b.getRelative(BlockFace.SELF).getType() == Material.SUGAR_CANE_BLOCK) {
e.getPlayer().getInventory().addItem(new ItemStack(Material.SUGAR_CANE));
p.sendMessage("+1");
}
}
}
}
}```
Wouldn't b now be set to air? So the if statement is now checking for something that can't even be?
Are you disabling the item drops?
can't do that in 1.8.8
you have to set to air
and before you scream at me to update I'm doing it in 1.8.8 for a reason
Hey, can I get some help? I want to change my spigot Profile Name
don't do this please that's not how this work
oh.. sorry didn't know
ask here directly your question or there
ok,
or both but make sure you update the forum side
i'm having a problem with FactionUUID
i'm trying to remove the "***[faction]" thing from the chat and i don't understand how to do it
for chat i'm using EssentialsX
and for the faction FactionUUID
and i yet figured out how to remove it
this seems like a format thing, maybe check config for both plugins?
i checked the config in essentials and i remove the {group} from the format
and still seeing the "***[faction] on chat
maybe check faction config?
there is no "config.yml" in factionUUID and i check every yml that is there and didn't see a line that talk about removing it
try contacting the plugin dev usually they know more about the workings of it all
ok, thank you for your time
how would I call entryAdded as an eventhandler from the litebansAPI in my plugin https://gitlab.com/ruany/LiteBansAPI/-/blob/master/src/main/java/litebans/api/Events.java
I need help before i kill myself
okayyyy..
two minutes
it is a custom enchants plugin i am making, i got the enchant to apply
and for it to reduce the amount of items of books if it is a stack
and for it to make a new item with the enchantment
but a item appear in the cursor
but if i set an item into the cursor, the item doesn't change but if i exit my inventory the item that i set to the cursor appear on the ground and i also have the item from the cursor.
@tiny dagger
oh hmm
this item is not in the cursor but in the cursor
cancell the event to you can't get the item on the cursor?
it is cancelled
maybe try calling updateInventory on the player? that usually fixes weird glitches i get
nmope
@smoky tundra @tiny dagger
is there a better way of registering commands, rather than just line after line of this:
registerCommand(new KitsCommand());
registerCommand(new CreateKitCommand());
registerCommand(new KitCommand());
registerCommand(new EditKitsCommand());
...
@frigid ember Player#setItemOnCursor() ?
how would there be a better way?
like directly putting the commands in to the bukkit command map
without having to register them in the main class or whatever
this does that
well
you would still need to get to the command map
and register them
but is there some method that automatically could do that
extending a super class ?
because having 30 commands and having 30 separate lines i would think is not convenient
that has the command stuff already in there
this is at least how i do it for my minigame arcade
i'm not really touching commands
i already extend a super class, but that doesn't really help
since i still need to call the method
i guess that is somewhat better?
not exactly what i was looking for but i'll try it
think so
that or go with reflections
automatically load the classes from a package
tried reflections before but it was starting to get way beyond my level of understanding
You can try the CommandAPI library.
used acf before but imo it doesn't offer that much flexibility with subcommands and aliases
Yo
then you used it work, lol
install java 14 or set your compiler to java 8
how would I send a POST request from a plugin?
go into your module settings in IJ and change it
Where are those settings
Wait.. How do u have a few projects in the same window
you just create modules?
this is all one project tho, those are submodules
but you can have many modules in one project
Maven --
So, My builders we're building then everyoen got kicked for this; https://i.gyazo.com/e3ba36a2e8c6139ed446c77ddfacf476.png
Hi, are there any people who own non-premium servers? I need help too
no support for cracked servers
How dose one fix my error 😐
How can i make extra Slots only for people with ranks?
Where would I get help with BungeeCord?
Ah shit
Oops lmao
Alright, I'm just rushing a bit nevermind that sorry
Apparently for BungeeCord, the installation warns of an exploit. I've searched for the exploit and it makes it as easy as having a bungeecord server on your localhost and zenmap doing very little to join any offline server as anyone.
Warned on installation:
https://www.spigotmc.org/wiki/bungeecord-installation/
Post I found it at:
https://www.reddit.com/r/admincraft/comments/6xlk01/warning_massive_bungeecord_exploit_allows_a_user/
Easy tutorial (cringy, loud, and maybe outdated) for preforming:
https://www.youtube.com/watch?v=RAfsWMmZLn0
Plug-in I don't know how to use but am trying to (PreventPortBypass):
https://www.spigotmc.org/resources/preventportbypass-the-onlyproxyjoin-alternative.54934/
Plug-in I compiled the master of and am unsure how to use also (BungeeGuard):
https://github.com/lucko/BungeeGuard
As the "unsure how to use" implies, I don't know what I'm doing in this regard despite looking into it. What do I do to prevent ipscanning allowing players to join without using the Proxy?
What/who is zenmap?
I don't know much about it but it was used to manipulate something to do with the ip when moving a player between ips or something like that
It's a program.
you should block/close the ports from the spigot server and only allow bungees port
Where do I do that? (I mostly have no idea where to go, I know what to do.)
are you using a vps?
local network?
I'm using a gsp
so ive got an interface that extends Comparable
which apparently is not ok
when it comes to the classes that implement said interface
any of you know a solution
java.lang.Comparable cannot be inherited with different arguments is the IDE error
@kind cove wots dat? 🤔
it's what the server hosting services use (I'm going off the installation page, I'm not too sure about the details)
https://www.spigotmc.org/wiki/bungeecord-installation/
Below "IMPORTANT SECURITY NOTICE:"
@wanton delta apparently you cant do Comparable<Class1> then Comparable<Class2> within the same class or whatever
so you're using a minecraft host? @kind cove
no thats not my issue
i have an interface
that implements comparable
and 2 enums
that implement the interface
but java doesnt like that
hmm
oh
i figured it out
enums automatically implement comparable
so i had to use generics
if anyone is remotely interested
I have to do that too
I am By_Jack
PLEASE
@raven shell
NO
oh
what
just use BungeeGuard i guess, you can't do much using a GSP
but you'll probably be more secure on a vps
what the heck
is not abstract and does not override abstract method compareTo
im so done why
its labelled as default in the interface
dumb
I found a video tutorial because I'm a pleb and I'll let you know how it works.
https://www.youtube.com/watch?v=N4NqnP4XWxk
this is stupid i hate java im quitting
bruh just use kotlin
i hate all of you
someone sent me a recommendation to do this.
One suggestion, is to add a little item in the players inventory that they can right-click to restart the spawn parkour but has a cooldown for 5 seconds to avoid spam
does anyone know a plugin that can do this?
a plugin that does what exactly?
click item in inv and teleport i think
have a reset parkour plugin or a parkour plugin that has a restart feature?
right click on a item that teleports you to a set location
my server is extremely lightweight, designed for no lag. i dont want a parkour plugin lmao
define a new location and
event.getPlayer().teleport(LOCATION);
but that's not with a cooldown, just how to teleport them
hes asking for a plugin
OH
not code
i hate that plugin
xD oof
._.
does anyone know of a clean way to get stdout as a stream from a spigot server? I'm trying to do some screwy stuff with docker and go but the fact that the jar runs as a command line is screwing with things a bit
stdout?
standard output
some programmer thing
ikr
because as it stands right now the only way I can run a server in a container and actually get the full interface to it is to run it as a temporary docker container and launch the server from bash within that
lol this isn't even C++ or java this is just shell architecture
-_- yes ik
@frigid ember get someone make you that plugin
@raven shell yes
not me tho 👀
I mean I could simplify my problem but if you don't know what I mean by the way I phrased that you probably won't be able to help. I don't mean to be a dick, I just know that I'm in some pretty uncharted waters here
alright now i gotta new issue
Error:(4,20) java: package litebans.api does not exist
Error:(5,20) java: package litebans.api does not exist
Error:(19,41) java: package Events does not exist
Error:(19,9) java: cannot find symbol
looks like you're missing a dependency
I put them into libraries
wait did you move these classes you're trying to import into different packages?
ok wait are you developing a plugin or just trying to run something on a server
developing a plugin for a server
ok so you added the jar as a dependency in your IDE right?
dependency
how do I do that?
are you using maven?
yea
add these blocks to your pom.xml:
This one is your repositories block:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
This one is your dependencies block:
<dependency>
<groupId>com.gitlab.ruany</groupId>
<artifactId>LiteBansAPI</artifactId>
<version>0.3.2</version>
<scope>provided</scope>
</dependency>
so it works now?
code is fuck'd but yea
that's how it always be
well are you sure that it's pulling the library correctly now?
alright cool
Is it possible to load in part of a world on both the server and client to get a smooth as possible teleport across worlds? Like lets say they are approaching a portal start loading in that world before they even hit it?
don't think that's possible without a client side mod, I know that back in tekkit we had anchors to handle that sort of thing but idk if minecraft vanilla has implemented any functinoality like that
Is there any way to get tab complete for a command.yml alias. The alias works but it still auto completes for the command im trying to mask which is a bit bothersome.
might be able to just declare it as a separate command in your plugin instead of an alias, should tab complete then
Hello
i was trying to figure out something for so long!
and after a day and a half found a solution
and didn't see a thing related to what i was looking for in the spigot website
where is the best way to post that solution so everyone can read about it
(sorry if i'm wrong about where i'm writing that i'm new and want to help other if they having the same problem)
well the stackoverflow way would be to google the problem you were having and post your solution in the first thread that comes up on google as a "Hey if you're googling this exact error, here's the solution you're looking for" kind of thing
trying to get auto complete work for a command. I have onTabComplete implement, the list of suggestions does show, but when I keep typing it just keeps showing the full list and if I hit tab, the first option gets selected. any ideas?
well the stackoverflow way would be to google the problem you were having and post your solution in the first thread that comes up on google as a "Hey if you're googling this exact error, here's the solution you're looking for" kind of thing
@solar magnet there is a section on spigot website that my problem will be relevant to post or make a thread ?
not gonna lie I'm not the most familiar with the spigot website
I'm pretty new here so far, I literally just got on this server today, I'm just trying to help out and give advice because I have some level of development experience and it seems like a lot of this community is very much beginner programmers
lol me to like hour and so
Hello
i was trying to figure out something for so long!
and after a day and a half found a solution
and didn't see a thing related to what i was looking for in the spigot website
where is the best way to post that solution so everyone can read about it
(sorry if i'm wrong about where i'm writing that i'm new and want to help other if they having the same problem)
@sullen crane
reposing
Anyone know if there are any massive issues with upgrading world files from 1.13 to 1.15
And if any steps should be taken to upgrade instead of just backing it up and just updating the server
I’d only be interacting with Overworld files
package me.y2k.nodeadbushremove;
import org.bukkit.ChatColor;
import org.bukkit.Material;
import org.bukkit.block.Block;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.block.BlockBreakEvent;
import org.bukkit.plugin.java.JavaPlugin;
public class DeadBushRemove extends JavaPlugin {
@EventHandler
public void onDeadBushBreak(BlockBreakEvent event) {
Player p = event.getPlayer();
Block b = event.getBlock();
Material m = b.getType();
if(m == Material.DEAD_BUSH) {
p.sendMessage(ChatColor.RED + "A Placed Deadbush is not simply broken");
event.setCancelled(true); }
}
}``` why isnt this code working im confused
what is a placed dead bush called I should ask
@sullen crane the plugins are completely updated, my only concern is in world files
don't think that world file are an issue
maybe regions
@hallow surge is your event registered? Material.DEAD_BUSH is a valid enum value, at least in latest docs
The event is in the main class should be registered
this.getServer().getPluginManager().registerEvents(this, this)
Make sure to add this somewhere in the onEnable method if you haven't already.
and your main should implement Listener
yeah
haha have fun once it works 🙂
also I'm not sure if it's just me but I don't like to have EventHandlers in my main class, usually I place them in separate classes but that's just personal preference.
Hello,
I have created a plugin that allows players to mount a personal Ravager - reskinned as an "Appa" from the Avatar series through use of a server resource pack.
When the player mounts it, if not in motion, the player is able to move their cursor and the Ravager's head will follow, and once its neck is stressed, it will turn its body.
Once the player begins motion, the Ravager's body rotation will revert back to a state that it was in before being ridden - though the Ravager's head will move within the 135-ish degree range that it can rotate without moving the body. Obviously this causes some very derpy looking movement in cases where you're not travelling in the direction that the Ravager is pointing.
I have yet to find a solution to this - it's been a persistent issue for quite a number of days now. I've tried disabling AI (which causes the entity to be unable to move when mounted,) disabling Aware (same effect as AI,) disabling all Pathfinder goals (same result as having them turned on), setting the rotation after setting velocity (same result as original problem), teleporting the entity to the same location with the player's yaw and pitch, all with no luck.
Here is my code: https://hastebin.com/yowupemulu.java
There are no errors in console. Any help or advice that you are willing to share, I would appreciate. If someone has a working solution, I'd be happy to Paypal you $15 for the trouble.
me either i just threw this together ina second
Also I've started to realize that custom events are so helpful
Makes things so much easier to code
What is a fitness event by feeling full(eat)??
sorry can you rephrase?
yes, yeet indeed
opps 😛 rephrase. What is a health fitness event by feeling full?
@inland depot might get into that than and learna bout custom events
@frigid ember Do you mean health regeneration due to a full hunger bar?
yes !
EntityRegainHealthEvent. Check if RegainReason is SATIATED.
Oh Thank you.
@hallow surge here is a really well documented thread to get started
https://www.spigotmc.org/threads/custom-events.335827/
I use this for envoys and other features on my factions server and it works like a charm
and entity is player ^
RegainReason can only be satiated when entity is a player, but yeah.
meh i do it just for redundancy
It definitely doesn't hurt. Haha
Also in the new update, pandas eating bamboo satiates their health no?
that was terrible phrasing
Not sure, actually.
is it possible to only print INFO instead of all that https://cdn.discordapp.com/attachments/573320217128730624/707401182179753984/unknown.png
like an option or something
There’s be no point as that logging is there for a very valid reason
But if you really want to, fork your own version of spigot and remove the loggings
afaik that’s the only way
im talking about the text before the INFO
in the prefix
server worker
i liked it when it had info only
it was neater
like this: [INFO]: Preparing spawn arena: 0%
@frigid ember are you trying to connect to a spigot server from bungee
pretty sure the spigot server needs to be in offline mode
watch a bungee tutorial
wdym
the spigot server needs to be in offline mode
once the spigot hooks into the proxy it will "be online" so to speak
@frigid ember
Hey guys, is there a way to disable the vanilla console that is now included in the builds?
need some help with the whole money note system
if any can help plz msg me so we can get in a discord chat
yes
that is my sencond accout
yes i did
sorry
it just says invald amount when ever i try to with draw an amount and sorry you gonna have to tell me were to find the desk code
wat?
private chat
this must be outdated, but the chat component says you can call create() on the chat builder and pass it directly to player.sendMessage(..) but that's no longer valid. any ideas how I need to send the result?
How do I get server to restart automatically at a certain time with a countdown?
Guys, do you know why my server takes a long time to load the worlds when its a new world?
https://hastebin.com/isunaxafiz.shell
With 1.8 the worlds load fine, but it takes a long time with 1.15, and I've had this problem on 2 hosting providers
@arctic stone first maybe try setting the restart script in the bukkit yml
private int getNextHellStoneId() {
int nextId = 1;
if (hellStone.isEmpty()) return 1;
ArrayList<Integer> keys = new ArrayList<>(hellStone.keySet());
for (int i = 0; i < hellStone.size(); i++) {
if (!hellStone.containsKey(keys.get(i) + 1)) {
nextId = i;
break;
}
break;
}
return nextId + 1;
}``` Am I just dumb or why does this return 1 every time? hellStone is not empty, and I know that because I did a debug msg, Usually I would just use .size() + 1 but you might as well reuse Ids that dont exist anymore
I see it now AHHH
i break after every time lmfao
is there a way to set where to launch the projectile from in player.launchProjectile?
You can do it with player.getWorld().launchProjectile
and then it takes a location, plus the projectile class
i see ok
What is the restart script for spigot?
@buoyant path There is no world.launchProjectile
maybe an older version?
Ok so you need to spawn the projectile entity then give it velocity
launchProjectile is no longer in World
Are you using arrows or something else?
Snowball, but got it spawnEntity then cast it to projectile
So you got it working?
Yep
Sounds good
Hello,
I am using ProtocolLib to grab the Vehicle Steer and Vehicle Move packets while riding a Ravager. My end goal is that the ravager's body rotate to match the rotation of the player during movement. I've got this working, but now the player rubber bands hardcore. I believe the issue extends from the fact that I am cancelling packets and then sending new packets, but I don't know what else to do. If someone wouldn't mind skimming over my code to help me understand why this rubber banding occurs, I would appreciate it. Code: https://hastebin.com/axufifuhin.java
Maybe use pathfinder instead?
This happens because you are sending a packet
Server knows the vehicle is in one place
Client doesnt
Client will catch up to the server eventually
I've tried pathfinder, couldn't find a viable solution with it =\
05.05 23:48:31 [Server] ERROR Error occurred while enabling Pets v1.0 (Is it up to date?)
05.05 23:48:31 [Server] INFO java.lang.LinkageError: loader constraint violation: when resolving method "com.deserialize.pets.Events.PlayerInteract.<init>(Lcom/deserialize/pets/Pets;)V" the class loader (instance of org/bukkit/plugin/java/PluginClassLoader) of the current class, com/deserialize/pets/Pets, and the class loader (instance of org/bukkit/plugin/java/PluginClassLoader) for the method's defining class, com/deserialize/pets/Events/PlayerInteract, have different Class objects for the type com/deserialize/pets/Pets used in the signature
05.05 23:48:31 [Server] INFO at com.deserialize.pets.Pets.registerEvents(Pets.java:185) ~[Pets.jar:?]
05.05 23:48:31 [Server] INFO at com.deserialize.pets.Pets.onEnable(Pets.java:70) ~[Pets.jar:?]
05.05 23:48:31 [Server] INFO at org.bukkit.plugin.java.JavaPlugin.setEnabled(JavaPlugin.java:321) ~[spigot-1.8.jar:git-PaperSpigot-"8b18730"]
05.05 23:48:31 [Server] INFO at org.bukkit.plugin.java.JavaPluginLoader.enablePlugin(JavaPluginLoader.java:332) [spigot-1.8.jar:git-PaperSpigot-"8b18730"]
anyone know what's causing this?>
Code?
How do I make server auto restart? With a countdown?
I remove the line 185 all together and it still says its there
Nvm
@frigid ember do you have a custom entity class? I'm just throwing things out there, but mabye override the tick method and set the head rotation or something?
This is a snippet from a dolphin mount plugin
@Override
public void tick() {
if (d) { // isLooking
d = false; // isLooking
double x = e - a.locX;
double y = f - (a.locY + (double) a.getHeadHeight());
double z = g - a.locZ;
a.pitch = a(a.pitch, (float) (-(MathHelper.c(y, (double) MathHelper.sqrt(x * x + z * z)) * Const.RAD2DEG)) + 10.0F, c);
a.aS = a(a.aS, (float) (MathHelper.c(z, x) * Const.RAD2DEG) - 90.0F + 20.0F, b); // rotationYawHead
} else {
if (a.getNavigation().p()) { // noPath
a.pitch = a(a.pitch, 0.0F, 5.0F);
}
a.aS = a(a.aS, a.aQ, b); // rotationYawHead
}
float yawDiff = MathHelper.g(a.aS - a.aQ);
if (yawDiff < (float) (-h)) {
a.aQ -= 4.0F; // renderYawOffset
} else if (yawDiff > (float) h) {
a.aQ += 4.0F; // renderYawOffset
}
}
}
I'm not using a custom entity, at least not yet
I'm not against the idea though
Mabye use player move event and set the players mount to the correct yaw? It appears the rotation's not being triggered by STEER_VEHICLE packet
Or am I misunderstanding the issue...
It's being triggered by the VEHICLE_MOVE packet, though I think I've found my issue - I was cancelling the VEHICLE_MOVE packets and sending a new one - but when I send a new one, it gets cancelled of course, because the listener is looking for that exact type of packet
So I need some way to "intercept" the packet without cancelling it
I have no idea then, just throwing some ideas out there. Perhaps this can help you if you choose to make a custom entity class? https://github.com/BillyGalbreath/Ridables/blob/v3.0/src/main/java/net/pl3x/bukkit/ridables/entity/animal/RidablePig.java
I actually spent quite a bit of time checking out Rideables and that file - I couldn't find anything of use 😦 Thank you for the suggestion
Well, I looked at RideableRavager
👍 sorry I couldn't be of more assistance
All good, I appreciate it
This seems to be interesting https://www.youtube.com/watch?v=MK6DB9JW3Iw
Does anyone know how to fix my error
what is your error though :p
Scroll up a bit
What does your Pets class extend?
It extends java plugin and listener
It looks like it's something with your dependencies
That’s what I thought, but couldn’t find anything that wasn’t right
Make sure you haven't used two different Spigot jars? Not really sure, haven't seen that error before.
I use maven to provide my dependices
Is anyone able to help?
Anyone know how to allow slime spawning?
Since there is a thing called a slime-chunk :3
how would I fix the problem of a double NAT? i have a netgear nighthawk AX4 and the software is not very flexible.
@narrow carbon https://minecraft.gamepedia.com/Slime#Spawning
Correct me if I'm wrong someone, but I believe either Spigot or Paper had an option to have all chunks as slime chunks.
I'm struggling with getting IntellJ IDEA to recognize my 'spigot-1.12.2-R0.1-SNAPSHOT.jar' is there. This is the error message I'm receiving.
import org.bukkit.plugin.java.JavaPlugin;```
I reviewed this page https://www.spigotmc.org/wiki/creating-a-blank-spigot-plugin-in-intellijidea/
Any help would be appreciated.
Yes I am, do I add something like this? runtime files('libs/spigot-1.12.2-R0.1-SNAPSHOT.jar')
or implementation files('libs/spigot-1.12.2-R0.1-SNAPSHOT.jar')
Excellent! Mind blown.
Now 'JavaPlugin' and 'import org.bukkit.plugin.java.JavaPlugin;' do not resolve in my Main Class.
What am I doing wrong here? Thank you for working through this with me. I started with Eclipse got my Hello Worlds working, but I need to use Gradle and IntelliJ for some other integration I'm doing with Spigot.
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven { url "https://oss.jfrog.org/artifactory/libs-release"}
maven {
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
content {
includeGroup 'org.bukkit'
includeGroup 'org.spigotmc'
}
}
maven { url = 'https://oss.sonatype.org/content/repositories/snapshots' }
maven { url = 'https://oss.sonatype.org/content/repositories/central' }
mavenLocal()
}
dependencies {
compileOnly 'org.spigotmc:spigot-api-1.12.2-R0.1-SNAPSHOT-shaded'
}```
Quick question; you are using IntelliJ, correct?
Yes
Are you using the Minecraft Development plugin?
I'm using the BuildTools.jar, and I got it working on Eclipse with no issues.
No, I mean, there is a plugin for IntelliJ.
Not that I know of.
Go to File --> Settings --> Plugins --> search Minecraft Development by DemonWav
No "Settings" or "Plugin" that I can see in IntelliJ
Mac all the way!
Is intellij really different on the mac?
I use it on mac
Apprently it's under Preferences..
it is
go to the Inellij Idea in bold
Then preferences
then plugins
then search for Minecraft Development
Found it, downloading.
OK
IntelliJ asked me to restart the app but it appears to be hanging now, is it finishing an install in the background of the Minecraft Development plugin tools?
I would hate for force quit anything that its running in the background....
@grave sand does whitemode hurt?
Give it a couple minutes, perhaps.
whitemode?
Light theme*
The background in coding? Nah.... doesn't bother me at all.
:3
YA, for Discord and Chatting I prefer Dark mode, light mode is for getting work done. 🙂
@frigid ember have you checked this out? it was created by Minidigger. Just Enter EntityRavager in the search field
@vital copper well, installed Minecraft Development for IntelliJ, not sure that it's working for Gradle installs, it looks like for Mavin it will setup all the JAVA files, but not for Gradle. I guess I can do it the old fashion way and create my classes manually, but what's the point of Minecraft Development plugin.
is there a way that I could fire an event when a particular chest is opened, without listening for all chests and going through a list of chests that I want to listen to and seeing if it's there? I anticipate this list getting quite large so it'd be very inefficient to do it that way
Don't use a list then
the chest is generated by my plugin, if that helps. Is there any way I could put a certain NBT tag on all the chests i want to listen to, then check if the chest that is opened has the tag?
alright, i'll check that out. Thanks!
Any idea why if I add "extends JavaPlugin" it gives me this error...
Error: Could not find or load main class com.rosebunnygamer.rbscoreboard.Main
I'm using IntelliJ with Gradle.
Isn't that supposed to be in your plugin.yml?
Is that the package for your plugin class?
Well, I have the following defined in my plugin.yml
version: 0.0.1
author: RoseBunnyGamer
main: com.rosebunnygamer.rbscoreboard.Main
api-version: 1.12.2```
..but why would it give me a compiling error at run?
I've seen that error at console when trying to load a plugin as a JAR but not when trying to get command line hello world output.
I'm struggling hard with Gradle and getting my Hello World setup.
Any ideas on why I would be getting this "Error" when add 'extends JavaPlugin' to my 'public final class Main extends JavaPlugin'?
Error: Could not find or load main class com.rosebunnygamer.rbscoreboard.Main
something is messed up with your project
Agreed!
have you tried turning it on and off again
Turned what on and off again?
the computer
AH. Oh you think it's a bigger issue.
no im joking lol
HAHAHA ok
why is your main void static
private static String authtoken = "7wo3az91iyr3gp10gsqd4r952v6tdy"; //SECRET
static abuse also nice key
Why is making a constant static static abuse?
just use constructors
You think that is the reason I'm getting this error?
no it's just some advice
OK
Your main class isn't actually a proper main?
lol
Like, why does it have a public static void main?
bro
public final class Main extends JavaPlugin {
how can it extend javaplugin if it's a final class?
that's your issue
Oh god.
lmao did you just copy this code from online?
Could have printed it out first and typed it all in
why wouldn't it
It means you can't extent Main
it's been way too long since i've done java
main itself can still extend shit
ah shit yh lol
No that didn't solve the issue. But no didn't copy following Spigot and Twitch API guide. Not sure why I included final but that was something that was after the fact.
also, I'd say that secret isn't very secret anymore
great security
Well, I'd recommend making that a configurable property. Something that gets read from your config.yml
That way you never have to worry about potentially making a commit with an actual valid token
hahah good point
So any idea on what else may be causing
Error: Could not find or load main class com.rosebunnygamer.rbscoreboard.Main
The "public class Main extends JavaPlugin {" has been updated without final, but is still giving issues
why are you using a main method and not onEnable?
😐
dont think he knows java
Unless it's full of caffeine and served in a mug?
lmao
read the javadocs before making plugins
So, mall, are you just trying to check with twitch to see the status of your stream?
YEP that's it.
I want to sent a message over to my MC server to show if we are online or not.
Looks like mall is using a java api for twitch, I just didn't know if it would be easier to use a GET request.
Without knowing much, it seems like you might need an oauth token, but that seems odd, if you're just requesting the status of someone's stream.
Yep, that's not where I'm having issues. It's "extend JavaPlugin" I have had Spigot tested and working in Eclipse, but I need to be using Gradle for some of the other tools I'm trying incorporate.
yeah a simple request to that url would yield some data
Yea, don't worry about that part, I'm just trying to get Spigot working JavaPlugin so I can use the Spigot library
what u mean working? just add the jar to your dependencies and extend..
@vernal spruce this is my gradle, but it's giving issues I believe
plugins {
id 'java'
}
group 'org.example'
version '1.0-SNAPSHOT'
repositories {
mavenCentral()
maven { url "https://oss.jfrog.org/artifactory/libs-release"}
maven {
name = 'spigotmc-repo'
url = 'https://hub.spigotmc.org/nexus/content/repositories/snapshots/'
}
maven {
name = 'sonatype'
url = 'https://oss.sonatype.org/content/groups/public/'
}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.12'
compile group: 'com.github.twitch4j', name: 'twitch4j', version: '1.0.0-alpha.19'
// YAML Parser
implementation group: "com.fasterxml.jackson.dataformat", name: "jackson-dataformat-yaml", version: "2.11.0"
compileOnly 'org.spigotmc:spigot-api:1.12.2-R0.1-SNAPSHOT'
}
import org.apache.tools.ant.filters.ReplaceTokens
take the code in your static void main method and move it into your onEnable method. Uncomment that method and comment out the main method
idk why bother with gradle didnt found anything special rather than eclipse/intellij
gradle is hella fast
agreed, but that's how the Twitch4J library works
It's just something else to learn LOL
@red zenith I will try your suggestion. thanks
if(config.getBoolean("prevent-otherthunder")) {
if(event.getCause() != LightningStrikeEvent.Cause.WEATHER) {
return;
}
//do the event results etc
is a good way to break the event
if the event is not caused by weather it needs to stop doing the things it would do normally
i do want the thunder to continue so no event.setcanceled
anyone?
personally i'd check if it's is a lighting strike, if it is then do your stuff and if not then return
@EventHandler(priority = EventPriority.HIGHEST)
void Lighting(LightningStrikeEvent event){
if (event.getCause() != LightningStrikeEvent.Cause.TRIDENT) {
if(config.getBoolean("prevent-otherthunder")) {
if(event.getCause() != LightningStrikeEvent.Cause.WEATHER) {
return;
}
}
//do the event results etc
i have this
i need users to be able to switch that on and off
@EventHandler(priority = EventPriority.HIGHEST)
public void Lighting(LightningStrikeEvent event){
if (event.getCause() == LightningStrikeEvent.Cause.TRIDENT) {
// do stuff if it's caused by trident
if(config.getBoolean("prevent-otherthunder") && event.getCause() == LightningStrikeEvent.Cause.WEATHER) {
// if the boolean is set to true and the cause was weather, do stuff
} else{
// if it's not weather
return;
}
}
//do the event results etc```
ive just done that in atom in a .py file so may not be perfect
but thats how id do it
if(event.getCause() != LightningStrikeEvent.Cause.WEATHER && config.getBoolean("prevent-otherthunder")) {
return;
}
just went with this
might not be perfect code either havent done java for abour a year and a half
ok fair enough
no else required i believe
Some of those comments are unnecessary as well 🤷♂️
How can I distinguish between GUI and hotbar?
open ur eyes @formal nimbus
Lol
How can I distinguish between GUI and hotbar?
@formal nimbus the slots numbers in the hotbar are from 0 to 8
clicking the first slot in a GUI returns 0 in event.getSlot()
What event is that?
They do,
Pretty sure you can check the type of inventory
@lilac wasp How?
I’m on a phone right now and I don’t know off my head you’ll just need to google that one
god returning to stop the method is just a weird practice
👍
like what's the reason of
if (n < 5) { return;}
doSomething();
just do
if(n > 5) { doSomething(); }
it's just unrequired code lines
Because what if you wanted to check multiple conditions are met and only do one thing
there are some specific cases where return; can be handy, but his didn't seem the case
Yeah he shouldn’t really have it but it’s okay I guess
I know
Ah right :+1:
I was just addressing the issue of Fendi complaining about my if .. return statements
I'm going to try and fix the actual issue now
and figure out how to not include the hotbar
ah
I've fixed it 😄
turns out there's a getClickedInventory() event, rather than just a getInventory() event
@boreal tiger @lilac wasp thx for the help
JetCobblestone one question
how do your eyes not hurt from absolute black background?
very easily D-:<
Hello i would like to ask stg.
In skript plugin i was using "stop" to stop the code
Are there anything i can use in java
I would like my code to stop if stg happens
you can disable the plugin
on a event you can just return;
Can you buy plugins with paysafe card ?
not on spigotmc forums
the developer might be selling the plugin in some other way/platform though 🤷♂️
its only paypel
yeah on spigotmc its only paypal.
but you can manually talk with the buyer to see if he can accept paysafe
I have had many of those 👀
I'm trying to enable debugging for my plugin in eclipse but it says "Failed to connect to remote VM. Connection refused."
java -Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005 -jar server.jar
So who can I talk to so I can buy it with passage ?
hello everyone, who should I talk to about an issue with logging into my spigotmc website account?
?support
alright, thank you!
nvm I just clicked the button more than once
Hi, I have a problem with bungeecord server. After two people joined the server, the third person could not join the server. And the error will be, "Too many connection from this IP adress". I set the server localhost.
i mean its pretty obvious..
there is most likely a ip limit in the config
usually auth plugins have it
Imagine using auth plugins
40% of minecraft servers..
Mmmh?
you would be surprised by the amount of cracked servers out there
wich require auth plugin..
It's not 40%
in my country there is not even 1 premium server
only cracked
and boy we have alot of em..
Like, authme has 10k servers, out of the 160k
do people use authme anymore/
mini you forget auth servers usually disable bstats
Even skin restorer only runs on 18k servers
Why would they be more likely to disable bstats than any other server?
Why would someone disable bstats at all
its preference
I don't see anything wrong with anonymous data
overall doesnt help the server at all..
If you disable bstats, you servers demographic isn't represented
because they have something to hide i guess
And ppl will drop support for you sooner
I use my own cracked launcher actually
For launching multiple clients locally
Cause I only have 3 mc accounts
i have a bot creator myself
Anyways, death to offline servers
1.9% online servers using authme wait wut?
Death to 1.8
I hope java 8 and 1.8 will just die
BungeeCord should just drop 1.8 to be honest
1.16 will also help paper 😂
how come?
if 1.15.2 didnt help then how will 1.6 help?
tbh 1.15 didnt bring that much
The wast majority of 1.15 servers run paper
73%
Anyone know how to get the location of where a tnt entity was spawned (PrimedTnt)
You can listen to interact event and check hand/block..?
Right now my server gets it right but then gets it wrong
if we drop support they would move but everyone has to do it otherwise is pointless
Bukkit
mostly the big plugins have to do it
worldedit/guard/essentials/vault
otherwise its...
They already
we did i think
1.16 will not change combat?
Combat snapshots aren't part of the 1.16 branch
they can change combat tho
Yes, they are experimental and not done yet
1.16 is almost done at this point
I wouldn't be surprised to see a prerelease in a few weeks
Will Mojang ever start to push Java 11
define legacy
But like, it's still a high percentage of the user base
Idk, some Intel shit iirc
Bone said something years ago
Is a GTX960 legacy?
Nah
And I mean
We have a chance to get render dragon
Then we could easily update java
Do you know about red dragon tho
haven't seen a mouse to render
you know what i would want? a good launcher wich can download files needed for the server
like csgo/arma...
so we can easly play a modded server on a click
Why need a launcher for that?
it does that
idk i enjoyed some modpacks.. rlcraft/sevtech/skyfactory/ozone alot of shit
i played
Imagine not using Streams
mc should implement no tick chunks in vanilla imo
I don't know if it's fault of the obfuscation or something else, but Mojang code is really outdated and wrong
usually code keeps improving overtime..
not theirs
Wat
I don't know if it's fault of the obfuscation or something else, but Mojang code is really outdated and wrong
This makes no sense
there are many unused variables which I haven't found a use of
not to mention outdated java syntaxes and usage
Unused variables come from paper/spigot/cb modifications
And from stripping out client code
Proguard removes methods and classes not used by the server
Or tries to
Understandable, I guess it would take a really long time to revisit by hand each one
so no one does it
i don't know if playerconnection was supposed to be accesed directly as a field
Hello guys i wanna ask stg
i have a config like this
Itemler: TuğrulKılıcı: Tür: Kılıç İsim: §6Ahmet Beyin Ceketi Eşya Tipi: DIAMOND_SWORD Gereken Seviye: 10 Saldırı Değeri: 20.5 Saldırı Hızı: 0.87 Kırılmazlık: true Nadirlik: §7§lSIRADAN TuğrulZırhı: Tür: Zırh İsim: §6Ahmet Beyin Zırhı Eşya Tipi: DIAMOND_CHESTPLATE Gereken Seviye: 5 Defans: 10 Can: 22 Kırılmazlık: true Nadirlik: §7§lEN AZ TUĞRUL KADAR
How can i make my plugin to tell the names of the items
I mean i tried getConfigurationSection and only get but i couldnt make it
I want to tell my admins the names with a command like /itemlist
for(String string : config.getConfigurationSection().getKeys(false))
String itemName = config.getString(string + ".İsim");
i dont want the ones İsim: i want the original names xd
But i think i get what u are trying to say
for(String string : config.getConfigurationSection().getKeys(false))
ill try thx
Man it worked thx
But i wanna ask one more thing
Can i make it one sentence ?
Oh i can make an array list i believe
Can someone help me with Scoreboards?
manager = Bukkit.getScoreboardManager();
blankBoard = manager.getNewScoreboard();
board = manager.getNewScoreboard();
o = board.registerNewObjective("scoreboard", "");
o.setDisplaySlot(DisplaySlot.SIDEBAR);
I have that code, I set it to the player when they join. I then have a runnable which should update the specific player's scoreboard according to their player info. But it seems to just flicker between accounts, e.g I have account X and account Y, it would flicker between Name: X and Name: Y
Objective pobj = player.getScoreboard().getObjective("scoreboard");
I'm using that code to update the player's scoreboard, any help?
I'm not sure, but you have to use teams to prevent flickering iirc
Well you aren't registering individual scoreboards per player
All you are doing is updating 1 scoreboard for all players in game.
Instead of updating that player's scoreboard.
Score spacer2 = pobj.getScore(Formatting.colorize("&8 "));
When I tried before, there was always an NPE on lines where you get the score
To update it smoothly you must use teams.
Explanation: https://bukkit.org/threads/preventing-scoreboards-from-flickering-changing-objectives.238711/
😂
HIIIII MR. CHOCOLATE
My bad @Choco. Next time I won't.
LMAO
hah
Async Bukkit 
All you need to do is update a team thingy (forgot what is was called) and ez
"was"
You just said was
i guess now it's paper
lmao no
👀
Who's gonna tell him that Spigot's primary dependency is Bukkit 
So what difference does it make using teams?
its really cool
well it was a needed dependency wasn't it?
imagine how many plugins wouldn't had worked if that was dropped
i started with skript
wtf
Who's gonna tell him that Spigot's primary dependency is Bukkit :FearSweat:
actually
spigots doesnt really depend bukkit
its a fork
dont use skript 😦
SuperiorFork.BUKKIT
hating on it is pointless because c++ people hate java too and i think it's because they don't understand it's uses
skrip bad
You can do ANYTHING with java
I don't think you can do EVERYTHING with skript
but idk
skript is good if used right
true
ok
MiniPaper is bad if used right
Why is santas sack so big? Because he only comes once a year.
here come the preschool jokes
guys i wanna replace [ in my array list with "" but the bracket makes an error
how can i fix it
String gonder = "§4Mevcut Eşya Listesi: " + items; gonder.replaceAll("[", "");
items is an array list
items.join(",")
so cool
Ooookey thx then ill try
Guava's API would be so useful in this situation.
Hey guys, I was wondering how you could take one experience level from somebody, I've searched those methods but i think those experience methods are not about full levels but experience points
ChatColor.translateAlternateColorCodes('&', "&4Mevcut Eşya Listesi:" + Joiner.on(",").join(items))
you just setlevel - 1
Imagine using translateAlternateColorCodes and §
setLevel is a method? XD
exp is for bar and it's a percentage
solo is sleeping 😄
from 0 to 1
Ah alright lmao thank you
Forgot to remove it after translating it 🤢