#help-archived
1 messages · Page 69 of 1
I calculate X and Z, and use uhcworld.getHighestBlockYAt((int) x, (int) z) + 1 for Y
brb
Doesn't getHighestBlockAt() return the highest air block?
Highest non empty
there was a fix for a off by one error regarding that method fairly recently
not sure if non empty includes air in that case
back
Leaves are transparent, though I don't think it looks for solid blocks
yeah, I was thinking the same, so I added this loop: ```java
//Check if the block they're being teleported to is air or not, if not Y+1
while(location.getBlock().getType() != Material.AIR) {
System.out.println(location.getBlock());
location = new Location(uhcworld, location.getX(), location.getY() + 1, location.getZ());
}``` aint really helping much though
lol that works too, though that seems like a bit of a waste though?
a safe bet is to start at sea level and work your way up
yep
for my uhc plugin i dont care about that and scatter them at y300 with resistance for 20 seconds
it works until you get scattered into a lava lake
then it isnt so fun
thats actually a good point, should add a check for that too lol
I have a random teleport for my wilderness feature, and I check to see if World.getHighestBlock is Material.LAVA or Material.FIRE
sec gonna post my question first before i take a look at the code so my clipboard isnt overridden
how would i go about removing all effects from a player? currently im using this but it doesn't work
for (PotionEffectType e : PotionEffectType.values()) {
event.getPlayer().removePotionEffect(e);
}```
I have a random teleport for my wilderness feature, and I check to see if World.getHighestBlock is Material.LAVA or Material.FIRE
@silent veldt I also check for cactus to be safe
you never know
cactus thats a good point too
or MAGMA if random spawn is inside nether
and water if you dont want angry players
Nah, its overworld only
^^^ yeah water
Hey, they can be angry if they want lol
people get triggered if they spawn in the middle of the ocean
I'm fairly new to the BungeeCord Plugin development, an i was wondering what would be the best way to go about join leave messages. I have it sending messages fine, but how can I remove/disable the default "<player> has joined" join/leave messages on the spigot servers?
I tried doing
@EventHandler
public static void onPlayerJoin(PlayerJoinEvent playerJoinEvent) {
playerjoinevent.setJoinMessage(null)
// I also tried playerJoinEvent.setJoinMessage("")
}
But it just stops my messages and keeps the normal join messages
its funny
I tell them to bring a boat if they're going to the wilderness
k
lol
why static eventhandler
@idle zodiac So what happens when you run the command?
yeah why the hell the listener method is static
@idle zodiac
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args)
{
if (sender instanceof Player)
{
Player player = (Player) sender;
sender.sendMessage("Le Command works L");
return true;
}
return true;
}```
@frigid heath pls no
No that isn't it
Anyone here ever worked with Google Sheets API within a plugin?
Use implicit else instead.
i dont actually know why its static lol
ill just remove it if intellij doesnt scream at me
not his
so regarding my issues, this is how the player is now TP'ed
nice
so regarding my issues, this is how the player is now TP'ed
@light geyser add +1 to Y
@light geyser just +1 lol
Yeah I do
//onCommand
if (!(sender instanceof Player)) {
//code if not a Player
return true;
}
Player player = (Player) sender;
//code if it's a Player```
+2 then
OK
Often it also happens that they just spawn inside the tree stem
ghetto fixes for everyone!
@light geyser there is a proper hightmap api that lets you specify if you want to ignore leaves
is this included in the spigot api?
yeah
i should make my plugin stop relying on resistance so i dont have to deal with potion effects
yes it is
just use my already existing damage handlers
Qther depends on what you're doing.
0.o thanks
you want MOTION_BLOCKING_NO_LEAVES
cancelling fall damage so players i scatter at y 300 dont instantly die
I think
@naive goblet were should i put that ?
Map<UUID, Long> cooldownMap = new HashMap<>();
//onCommand
Player sender = (Player) sender; //instanceof check first
if (!cooldownMap.contains(sender.getUniqueId()) {
cooldownMap.put(sender.getUniqueId(), TimeUnit.MILLIS.toSeconds(System.currentTimeMillis()));
} else {
long current = TimeUnit.MILLIS.toSeconds(System.currentTimeMillis()),
original = cooldownMap.get(sender.getUniqueId());
if (current - original > 5) {
//code if it has been 5 seconds since last execution
} else {
//code if not
}
}```
It just says "/kit" in chat when I execute it
@light geyser https://hub.spigotmc.org/jira/browse/SPIGOT-5523
yep that bug explains my issue then
gnaboo where you want?
and then just getHighestBlockAt(x, z, HeihgtMap.MOTION_BLOCKING_NO_LEAVES)
Apparently they are still figuring it out, so I wouldn't rely on the behavior either way
Just keep a reference of the map
@frigid heath Just use setAllowFlight == true for a few seconds
if (cmd.getName().equalsIgnoreCase("randomtp")) {
player.sendMessage("§2Vous allez etre §5teleporte de facon aleatoire. Sortez votre §9seau d'eau");
Random random = new Random();
Location plocation = player.getLocation();
Location rtp = new Location(player.getWorld(), plocation.getX()+ random.nextInt(500), plocation.getY()+random.nextInt(100), plocation.getZ()+random.nextInt(500));
player.teleport(rtp);
}```
Well, they might abuse that though
true
i should use that method for scatter instead
mmm mightve been using the wrong one then, explains it
might keep mine for a future elytra scatter
xd
also like, you are just teleporting the player way up in the sky
@idle zodiac Do you register the command is plugin.yml?
if (cmd.getName().equalsIgnoreCase("randomtp")) {
Map<UUID, Long> cooldownMap = new HashMap<>();
//onCommand
Player sender = (Player) sender; //instanceof check first
if (!cooldownMap.contains(sender.getUniqueId()) {
cooldownMap.put(sender.getUniqueId(), TimeUnit.MILLIS.toSeconds(System.currentTimeMillis()));
} else {
long current = TimeUnit.MILLIS.toSeconds(System.currentTimeMillis()),
original = cooldownMap.get(sender.getUniqueId());
if (current - original > 5) {
player.sendMessage("§2Vous allez etre §5teleporte de facon aleatoire. Sortez votre §9seau d'eau");
Random random = new Random();
Location plocation = player.getLocation();
Location rtp = new Location(player.getWorld(), plocation.getX()+ random.nextInt(500), plocation.getY()+random.nextInt(100), plocation.getZ()+random.nextInt(500));
player.teleport(rtp);
}
} else {
player.sendMessage('Please wait for the coolddown')
}
}```
@silent veldt Ye
i use ThreadLocalRandom over Random, it has more stuff
version: "0.1"
author: OccyDaBoss
main: me.islimyocelotzbe.spigotplugin.Main
commands:
kit:
description: Kit
usage: /<command>```
this is my random lol
Random rand = new Random(player.getUniqueId().getMostSignificantBits() * System.currentTimeMillis());
Random rand2 = new Random(player.getUniqueId().getMostSignificantBits() + System.currentTimeMillis() * 777);```
?
rand is used for x and rand2 is used for z
Location location = new Location(uhcworld, (int) x, uhcworld.getHighestBlockAt((int) x, (int) z, HeightMap.MOTION_BLOCKING_NO_LEAVES).getY(), (int) z);
``` seems to do it 🙂
oh god that is even worse qther
let me just steal that code real quick
lol
reference ? @naive goblet
It's displaying usage because you are returning false it seems
want the rest of the spreading code too? @frigid heath
ppl need to stop missuing random like that
That's the default
yes im aware that means people can reverse engineer the random but doesnt really matter
I'm returning true
i mean its a random world
It seems that way, but the fact it's displaying /kit is showing otherwise
how do i use pitch in playsound
lol oki, Im fine with sending it over though 😄
🤣
I mean, it seems right
Map<Object, Object> map = new HashMap<>();
method() {
//referencing map
map.get(someObjectInstance);
}```
just dont create new instances all the time...
properly is something i have trouble doing
seems to work 🤷♀️
oh ffs
@idle zodiac Try changing your usage text and see if the message changes. Change usage: to Test Message
don't past code like that
will do
Dutch pls bin when having long code blocks
https://pastebin.com/VLB7xF9r there, sorry 😄
private static final var RANDOM = ThreadLocalRandom.current();
that's it
aaah people using math in scatter algorithms!
what is this
Hmm...
Mm why's that wrong @frigid heath ?
someone may complain about me using var
They need to be evenly spread over a circle 🤷
Change kit: and see if it breaks the plugin
how should i include
Map<UUID, Long> cooldownMap = new HashMap<>();
//onCommand
Player sender = (Player) sender; //instanceof check first
if (!cooldownMap.contains(sender.getUniqueId()) {
cooldownMap.put(sender.getUniqueId(), TimeUnit.MILLIS.toSeconds(System.currentTimeMillis()));
} else {
long current = TimeUnit.MILLIS.toSeconds(System.currentTimeMillis()),
original = cooldownMap.get(sender.getUniqueId());
if (current - original > 5) {
//code if it has been 5 seconds since last execution
} else {
//code if not
}
}``` so that the code if the cooldown is ok is :
```java
if (cmd.getName().equalsIgnoreCase("randomtp")) {
player.sendMessage("§2Vous allez etre §5teleporte de facon aleatoire. Sortez votre §9seau d'eau");
Random random = new Random();
Location plocation = player.getLocation();
Location rtp = new Location(player.getWorld(), plocation.getX()+ random.nextInt(500), plocation.getY()+random.nextInt(100), plocation.getZ()+random.nextInt(500));
player.teleport(rtp);
}```
im just terrible at math
plzzz don't flood the chat with code
To ensure plugin.yml is being saved properly
sorry
mobile users are dying right now problably
so register kitz: instead, but don't change it in the code
feel you there @frigid heath . if you want to copy my code though, feel free to. Open source for a reason
bye mini
?
gnaboo I Will assist later on phone rn
Sorry, I'm noobn
I think spigot has a WIKI tut for it though
@idle zodiac In plugin.yml, change kit: to kitz: to see if it breaks the plugin. I want to see if the changes you make to plugin.yml are being built into the plugin
ok
@light geyser the reason i tried to make it completely random was to mimic other uhc plugins actually they're pretty bad at making even spawns but yours is definitely great at making it even
I did my best 😄
nvm i changed the wrong whatsit
ill probably do something like it as a config option
it should spread 99-100% evenly 😄
lets try again
at least, according to the maths
OK, no need to change the kit: then. Just change usage 😄
it'll probably need some changing though cos lava, water, fire, and cacti
Yep I need to add that still
now it just says 'Unknown Command'
you cant really predict whats there in a circle until you check it
What did you change the text to?
will prob do something like if(lava or cactus or fire) do x+1
i changed /<command> to Ding Dong the Witch is Dead because i'm funny and quirky
and just continue that until there's no danger left, then get Y
@frigid heath If this can help you or anyone else
https://github.com/TheViperShow/RandomJoinLocation/blob/master/src/main/java/me/thevipershow/randomspawnlocation/runnables/LocationsCalculator.java
Should still work though. Lemme check the javadoc
thansk
technically it does help but not in this situation
Yeah, that's the behavior..
Executes the given command, returning its success.
If false is returned, then the "usage" plugin.yml entry for this command (if defined) will be sent to the player.
also, @frigid heath I pregen the chunks, which should make checking a whole lot easier and faster
I know, I see that
welcome to coding
well now you're one step ahead of me
XDD
I haven't done spigot before so
I'm used to Java though
from Forge and other things
Your code looks correct. Add this to onCommand, before you check if the sender is a player
Bukkit.broadcastMessage("OnCommand start");
honestly i might just spawn them in with a boat and with fire res
I'm starting to get used to spigot with js because I dont want to deal with java's oop shit 😩👌
OOP has nothing to do with Spigot
Yes
java's oop shit
i like OOP tbh
I dont like being forced to use classes rofl
I like OOP
how do you even do things without OOP tbh
^
it basically becomes C at that point
OOP saves us from so much BS
You think null pointer exceptions are bad? Try playing with pointers
@silent veldt did you manage to find a fix
Did you do what I asked?
Feel you @silent veldt. Picked up C++ recently...
Your code looks correct. Add this to onCommand, before you check if the sender is a player
Bukkit.broadcastMessage("OnCommand start");
Lol that's how I do debugging in minecraft
same here
Not running is it?
Your onCommand section isn't running
System.out.println() or cout, my favs for debugging lol
my brain
Yeah but then you have to watch the console
yeah true, not an issue for me though rlyu
Yeah there are better ways I know. But this is visual and quick and dirty 😄
and my c++ applications have so far all been console only lol
And plugin.yml. Sorry but it's important
oh nm
You still have /<command> as the usage
its not working
sorry
i'm just
like very quirky and funny like
haha
very funny moment
ye i stop
Change usage to a single word, Test. Then try it, for giggles
Also remove description
Really?
you aren't ever checking the arguments
Doesn't matter
he's returning true
When you return true, it shouldn't display usage, no matter what you do in onCommand
Also, he changed usage to Test
Silly question
You aren't using tabs in plugin.yml are you?
Make sure all the lines contain spaces
i'm just doing what intellij gave me
Go to the start of each line and press right to count the spaces, on the lines that are indented
is it 2 spaces for an indent?
2 for each level
y
ok
If it jumps immediately to the right, that's a tab
my usage was 1 space too short
that explains it
try it now, with Test as usage
ok
usage: Test
Did you refresh your project before compiling? I know eclipse likes to ignore changes made in an editor if you don't refresh
i'm doing intellij
I realize that
IntelliJ probably doesn't have that issue TBH
Change kit: to kitz:
ok
Eclipse sucks
ye
See if it breaks
It's so bad it won't even recognize the online javadoc for spigot
amazing how people try to bash Eclipse
on every possible occurence of unknown errors
unknown command.
Choco uses Eclipse , am I right?
I bash Eclipse for issues I know are with Eclipse and they won't fix them
I've used Apache NetBeans for a long period before switching to IntelliJ
I don't 🤷♂️
netbeans
Give me a minute @idle zodiac, going to do something
I think I still have it installed
is there a way to import mojang authlib with maven?
i can't really find much to go on
is it NMS?
Hi all, the verification bot that spigot uses, it it possible to learn more how that works? I would like to create a simular bot. Someone logs into my discord server, they use ./verify <spigotusername>. The bot then looks up and see if that user has purchased the plugin, if they have They get a message on the forums, they use that to verifiy and I assign them to a group.
not nms
[15:35:52] [Server thread/INFO]: [Helpful] org.bukkit.craftbukkit.v1_15_R1.inventory.CraftInventory@67d2a5b8
[15:35:52] [Server thread/ERROR]: Could not pass event InventoryCloseEvent to Helpful v1.0
Can't we listen for this event? 🤔
@tiny dagger you can install .jar files in local repository
if there isn't a public one
tbh i only need to use the gameprofile class
if it's so much of a hassle i can just pass value and signature instead
its not much hassle
you can install any .jar files under any maven package names
with one command
but there isn't much point of doing that because you can also use <system> scope
yeah
its equally bad solution
I have a creative server and was wondering if there was a way to disable the use of the toolbar because people have been taking advantage of it and crashing the server
Ping me if you know an answer
toolbar?
toolbar?
Hello I have a question how do I get the zero out of my self-programmed tablist? I use 1.15.2 https://prnt.sc/se657y
You know the saved toolbar that came out in 1.12
Your basically able to save items and take them out in creative mode
oh I got it
how are people crashing the server with them tho?
1.8-1.15
the jar is 1.15.2, shouldn't it be fixed there
People can save these special items and take them out on my server and it crashes it
Also was wondering if I could disable the the of blocks ex. TNT
@idle zodiac Still around?
zelenskii send stacktrace
People can save these special items and take them out on my server and it crashes it
@frigid ember what special items?
why when I start my run spigot file this window is opening ?
which window
I can't put a screen
the gui thing?
make sure you put in nogui as a startup parameter
^
--nogui at the end
java -Xms1G -Xmx1G -jar spigot.jar nogui
ok tranks
How to convert id to Material ?
thanks*
id?
item id
Yes
who's even using IDs anymore
1.8.8 people be like 🤬
it's only natural that in 1.15.2 ?
I Must block item from mod on server
item ids are depreciated tho?
does that still work?
i don't know what that dude is doing with his outdated version
people still code in 1.8.8
Ik for sure you cannot use the id's in commands anymore
no, but they still are saved in the Material Enum
ah so they would have to create a helper class to convert them
people still code in 1.8.8
@hallow surge 🤮 let's hope it dies asap
something like that
also tadzio is trying to block an item from a mod so xD its not vanilla
@limber moth pretty much you can make an item with a command block and save it to your toolbar and use the item in any server as long as your in creative mode
how are command blocks even that powerful
right, did spigot add anything to the api so we can even try and prevent this?
@frigid ember
I have no idea
command blocks are very powerful lmfao
do they have to try and use the item like place it or what happens there
how to block item from mod on server ?
or is it just selecting the slot crashes the server
tadzio wdym mod
like galacta craft
thats already blocked players cant use those xD because its not vanilla
iirc
They use items like shulkers to lag the server till it crashes now I can’t even figure out what’s going on with my own server because every time I start it a couple seconds later it stops
mod???
you need to start logging whats happening otherwise you wont know how they are doing it
You would have to block certain items / events to prevent it I dont think there is an out of the box solution here for it
I can’t prevent any of it I have a player base with 20 other people it’s been a rotation of me just banning people clearing plots etc
try some plugins
well right now you dont know the exact cause on how they are actually crashing the server only an idea of what is going on
log every item placed, every interaction, you should be able to figure or get some sort of an idea on how its being done
there is no need for shulker boxes on creative
i think anyway
no
It’s hard to explain it’s like a shucker full of special items and when someone opens it they crash
you could for example allow them to be placed but not interact with the contents inside
In help.yml. Adding a general topic. Anyone know what to place after "permission:" So when players use /help it shows? I have what I want added showing for ops, but not players.
Hey!! Lately I've had some issues with people botting my network & I've came to the point were I would like to add a captcha. I've seen some servers were you need to add the server to your servers list in order to join. Does anyone know how I possibly could get something like that?
chewbacca you might be dealing with the book ban exploit highly likely
It’s like these books filled with special characters
looks like Y2k has it
ah so it crashes the clients
its all client side shouldnt crash the server
makes sense
no
book bans are vanilla
yes
so is the book dupe
its because they had a char limit on booklets
the dupe yes
pre 1.13
but you don't get banned for duping
@frigid ember yuo need an anti book dupe plugin should prevent book banning
yeah but book-banning is not a thing in vanilla
the server doesn't ban anybody automatically
nope
there is not a single line in Spigot that bans players
they may be kicked, but not banned
omg you idiot
its not a ban ban its a false ban that stops you from playing on the server
xD
due to your client crashing
its not an actual ban
lol
well since you were saying 'banned'
dude its what its called book banning
i never played on 2b2t so I couldn't know
someone made up the term, but its called book banning
because its basically what it does
its more like a denial of service to some extent
using an item to cause it
what you need @frigid ember is someone who knows how to create this exploit and test that plugin to see will it prevent it
as soon as he said this i knew exactly what the problem was
It’s hard to explain it’s like a shucker full of special items and when someone opens it they crash
yep and the title of this seems to confirm it
Bookbanning is a practice used to "ban" unsuspecting victims. To book ban, you need to fill three shulkers with ban books.
should verify it with someone whom knows how that exploit works to to make sure it does in fact work
i have no idea how to book ban but i think chewbacca should try it tout
Now what am I supposed to do about my server saying server closed as soon as I join I checked logs and crash reports can’t find anything
you were book banned xD
LMAO
you may have to delete inventories would that fix it?
What is the maximum volume level for playSound ?
thats insane
At 100 the sound is not enough audible for me
there is your answer 🙂
I clearly hear the music and others sounds
does it allow higher than 100?
I don't know, I haven't tried that's why I'm asking for not being dumb
I would try it, as I dont know
@frigid ember your creative server 🙂 dangerous stuff for hacked clients
you need to ban spawner placement etc
i could crash your server with a ender dragon spawner
the api doesn't specify a limit, it only says its a float datatype
which multiplies until it breaks the map
Thanks
In help.yml. Adding a general topic. Anyone know what to place after "permission:" So when players use /help it shows? I have what I want added showing for ops, but not players.
So how would you clone a root in a config file.
e.g
x:
y: 1
z: 2
into
a:
y: 1
z: 2
Even if I google it, it'll change nothing.
After reading that and doing my stuff, nothing change, the sound is still inaudible at 1 block away
https://hub.spigotmc.org/javadocs/spigot/org/bukkit/World.html#playSound-org.bukkit.Location-org.bukkit.Sound-float-float- I used this with level 10 volume
and it works.
On which sound? EVENT_RAID_HORN ????
Hey!! Lately I've had some issues with people botting my network & I've came to the point were I would like to add a captcha. I've seen some servers were you need to add the server to your servers list in order to join. Does anyone know how I possibly could get something like that?
is there a way to switch the package explorer look in intellij
yeah there are some captcha plugins i guess
aren't those bots under a VPN anyway?
But its really outdated
Yes they are
Thats why I need a plugin like the one I sent
I'm pretty sure that plugin is bypassable easily
it only checks if the client has stored the server in the server list
Yea
And OQ minebot uses directconnect
Don't want to ban VPNs
As they block internet cafés and such
How can you delete Files in a specific Folder?
for (File file : files) {
file.delete();
}
more of a java question, but can i use ThreadLocalRandom.current().nextInt() twice in the same line?
why wouldn't you be able to
ah so it isnt fully time dependant?
cool thanks!
What are some best practices regarding updating a Player's lastDamageCause ?
I'm running into some behavior I feel is extraneous but it may just be due to me not fully understanding how to update this field.
Im working on a AntiBot plugin, is it allowed to share like stuff here to get feedback on ideas?
https://bukkit.org/threads/set-last-damage-cause.291541/ @neon matrix xd
first google result haha
I know how to update the field. I'm not a fucking ape; thank you.
Here's the code I am using.
https://sourceb.in/bff6754e9f
The idea is that I fire a different event when the EntityDamageByEntityEvent is fired.
However when the grave is created (external event), the lastDamageCause is always EntityDamageByEntityEvent rather than PlayerPVPEvent
what's that, kotlin?
yes
Sorry I have a custom events system
The events all fire normally
Checked with the debugger agent
That looks like this
Events.listen(this, EventPriority.HIGHEST, this::onEntityCombat)
Events.listen(this, EventPriority.HIGHEST, this::onPlayerPVP)
Events.listen(this, EventPriority.HIGHEST, this::onGraveCreate)
GraveCreateEvent is fired from an external plugin, through PlayerDeathEvent
victim.lastDamageCause = pvpEvent
might also have something to do with all the events being highest priority
ah i see
val pvpEvent = PlayerPVPEvent(attacker, victim, event.cause, event.damage)
Events.fireEvent(pvpEvent)
if (pvpEvent.isCancelled) return
victim.lastDamageCause = pvpEvent
you set the cause after firing the pvp event
Yes the last damage cause should only be updated if the pvp event was successful
If the pvp event is cancelled, no damage is taken
you don't cancel damage
Oh this is interesting
I dont cancel the original damage
Do you think this might solve the issue?
if (pvpEvent.isCancelled) {
event.isCancelled = true
} else victim.lastDamageCause = pvpEvent
why dont you try it
How do you check if an item is floating on top of a hopper?
I've tried
if (e.getLocation().getBlock().equals(Material.HOPPER)) {
plugin.logger.info("There is an entity on a hopper!");
}
An item wont float up there for long unless the hopper is full I think :p
Its full
But it's not working
It's floating like that, but I am not getting any output
Do I not need to get the block below #getLocation()#getBlock()
entityLocation.getBlock().getRelative(BlockFace.DOWN).getType() == Material.HOPPER
maybe this?
or even SELF
Is it even possible to set an entity's last damage cause while inside of the event that would be the entity's last damage cause? lol... if that makes sense
Inside the scope of the event listener method, the lastDamageCause is fine, but then when checking it later it is just not.
maybe not, you could pass a damage cause into the event though
and override damage cause methods
no, you can't update the damage cause without cancelling the event first. Any attempts to update it would be ignored by the server.
So I must cancel the EntityDamageByEntityEvent and then apply the damage by hand?
or, create a new event with the values you want
You should be able to manipulate?
You could cancel the event and in the same event method create a new event with updated values or apply the damage yourself
but if you don't cancel the event, the server uses the values from when the event was created and not what you want it to use.
This is due to the fact that the referenced objects are used in the implementation if it isn't cancelled as opposed what was changed in the event.
That is, the implementation doesn't check the event itself after the event is created other then if it has been cancelled or not.
I think it is intended that way because there is usually more then one plugin that would try to change things and the easiest way would be to require that it be cancelled otherwise it would be down to whoever last updated the values plugin wise that wins as well as causing the server to wait on every plugin that wants to make a change since it isn't async. That would be more chaotic then just simply having the need to cancel it first if you don't want it to apply.
in this manner, plugins can still listen for the event even if the event was cancelled and still do something.
I dont intend on manipulating the damage at all
Maybe I will just do this the long way without all the extra events and hard coupling
entityLocation.getBlock().getRelative(BlockFace.DOWN).getType() == Material.HOPPERmaybe this?
@sturdy oar This worked ty
the other way to get to work @remote socket is to get the block 1 down from the location of the item
either way works
😎 xd
no problem
although I'm not sure but since hoppers are not full blocks items could technically be in the SELF blockface
you may check that
Hoppers count as tile entities, which are blocks, like chests are, that have inventories.
so, you should be able to get it using the location of the item entity as long as you know you need to adjust the y value of the location to be 1 down.
How can you check the amount of items in an entity?
you grab its inventory
Should first check that the block or entity you are referencing does indeed have an inventory though instead of assuming it does.
How do u grab its inventory? I do not see a method
hey so im a complete noob at java and the spigot api but how would i set the MOTD on command?
well
?jd
By this I mean the entity is a stack of floating blocks
the only block I know of that can hold items even as an item, is shulker boxes. All other inventory types tend to drop their inventories upon becoming an item entity
Basically my issue is that it detects a stack of blocks only as one
@split oxide https://hub.spigotmc.org/javadocs/bukkit/org/bukkit/event/server/ServerListPingEvent.html
this is all you need
Does anyone have a good resource for pasting schematics?
WorldEdit
???
Thank you FendiTony
I need one that I could edit
I need to make it paste block block with effects
@fleet burrow you can look at world edits code to see how they do it, and then modify it to your liking since it is open source.
only caveat is that if you choose to use their code, you need to abide by their license
I know how I could paste one and all
I was just wondering if there was an already available resource 😛
🇶 Is there a way to get the actual fire block from EntityDamageEvent when the DamageCause is FIRE? I checked and made sure that the event was not EntityDamageByBlockEvent. I couldn't find any methods in there that would give the block. Would I need to check the block underneath them?
I have an Entity, which is a dropped item. How do I know how many items there are?
Item#getItemStack
um so for some reason i cant use any of my bungeecord commands even thoughn im opped
i sue luckperms as my permissions plugin
Temporarily disable/remove lp to see if it is the cause
How can you check the amount of items in an entity?
If anyone is interested I managed to do it by doing this:
if (e instanceof Item) {
ItemStack itemStack = ((Item) e).getItemStack();
int amount = itemStack.getAmount();
}
what is e 😐
Entity object
um so any reason why?
@wind dock do other op abailities work? Is it only bungee not working?
abilities
only bungee
so paper and spigot, I hear paper offers far more customization aswell as more improvements to performance. anybody know of any benchmarks comparing the two together side by side?
nvm got it solved @patent monolith thnx
Has anyone ever seen an error like this? https://pastebin.com/FbCzPUp5
Someone on spigot gets this with my plugin, but it's working for myself and everyone else who's installed the update. I can't really reproduce it if I don't get it.
Just wondering if anyone knows what's happening.
hey guys, quick question. I worked on my plugin and it worked, but since today building the project, I get the java.io.FileNotFoundException error because the jar does not contain the plugin.yml, but it worked before. Using maven, plugin.yml is like it should be. But it does not really make sense why the plugin.yml is not there, any idea why?
never had this error in my entire life tbh
@frozen kiln ask them to delete their current jar and re-upload the plugin to their plugins folder
Ok @patent monolith, I'll try that.
@warm carbon open the jar as an archive and see if plugin.yml is in there
what exactly do you mean as an archive? opening it with winrar for example?
yeah
looked it up, seems as if the resource folder is not there
putting it in there always worked out, and worked yesterday and the days before as well, but now it just doesn't
that is why I'm curious
@warm carbon forget the ide. After you compile the plugin, is the plugin.yml in the jar? (Use winzip to check)
If not, then your IDE has a problem
nope, it is not. I compiled another plugin and there it is
but just not for that project
even though the plugin.yml is at the same location
it apparently skips it for that project since today
nope, it is not
even though the plugin.yml is at the same location
Is it in there or not
Then that is your answer
In the end, the plugin.yml needs to be in there
So your IDE may not be packaging it in there
I see, but I am just curios why something that worked before for that project, and others, but just now it does not
but yeah thanks fam, I'll look it up
How is it possible that a item from a list can get removed from simply calling .get on it
How do you set the skull rotation, in correlation with the player's Yaw?
@vernal spruce if you implement List you can override the .get() to do more then just get the something from said list
@keen compass thats the problem im not doing anything
i even siwtched to a hashmap to get a random item from it
Random rnd = new Random();
int toGet = rnd.nextInt(easterItems.size());
return easterItems.get(toGet);
}```
beside just simply removing it from the list its somehow removing it from the config file itself
how can this happen..
fixed
Somehow calling entitydeathevent.getdrops.add removes everything
related to the item added
so i see both bukkit and spigot dont have an entity despawn event, how could i work around that? context: i need the particle effect of my custom mob to stop when he gets despawned
does that work for despawned?
I have an GLITCH with NameTagEdit Plugin. Can someone help
i tried using the ChunkUnloadEvent but that doesn't always work, since it appears sometimes entities despawn while chunks don't
...
just ask ur question
I can't send ss
hi
or verify ur account with forums
Oh, yeah
The prefix is [Builder] (with some colors) but it shows me that:
No errors or logs
@tranquil rampart May you provide code here with using pastebin/hastebin?
and its likely not a spigot issue we can help with
unless its a plugin youre developing yourself
Hi, I'm looking for a plugin on ServerNpc, similar to the attached photo
How can I check if a variable contains a online player's name?
Hi, is there anyway I can return all vanilla redstone mechanics in spigot? AFAIK redstone mechanics were changed to make the server more fast and optimized
private void onA(IslandPreLevelEvent event) {
Bukkit.broadcastMessage("level " + event.getLongLevel());
Bukkit.broadcastMessage("pp " + event.getLongPointsToNextLevel());
event.setLongLevel(100);
Bukkit.broadcastMessage("level " + event.getLongLevel());
}```
this code is working perfect but
```@EventHandler
private void onA(IslandPreLevelEvent event) {
Bukkit.broadcastMessage("level " + event.getLongLevel());
Bukkit.broadcastMessage("pp " + event.getLongPointsToNextLevel());
long x = event.getLongPointsToNextLevel() - main.dataMap.get(event.getPlayer()).getPoint();
if(x <= 0) {
Bukkit.broadcastMessage("if");
Bukkit.broadcastMessage("map " + main.dataMap.get(event.getPlayer()).getLevel());
event.setLongLevel(event.getLongLevel() + 1;
main.dataMap.get(event.getPlayer()).setPoint(1);
Bukkit.broadcastMessage("level : " + event.getLongLevel());
}
}```
but this code doesn't work
afaik neither should work. Last I recall, event listeners cannot be private
Does anyone know plugin which can make this function: if you die in specific multiverse world than you'll spawn in specific multiverse world's spawnpoint?
That's normal if you don't understand me. Sorry for it
Well
get the world of the player who died and respawn him in that world spawn point?
I don't think mv has it's own sps
It only manipulates default world data etc iirc
@frigid ember If you're using stock BungeeCord (or Waterfall), It's most definitely a plugin doing that. What plugins do you have on the BC server?
https://imgur.com/a/GPt62Ts - Has anyone over seen this happen? I have reset The End several times by deleting the world folder and it was recreated the same every time, except for this time where I find the exit portal spawned above ground.
Hmm well I suppose it's going to generate same aslong as the seed is same on the overworld?
Seed has not changed
I've reset it 10-12 times today, but this just happened now.
normal and nether folders remain
Idk how it works for the end but coordinates can be involved i guess.
It seems to just be a drunk generation, why it happened times is kind of hmm.
The rest of the world is the same. I noticed this cross before https://imgur.com/a/6T0LODT
Its just that one part thats raised. So weird...
Not a huge problem. I can get around it for sure. It's just odd.
I'll save the files, just in case
Do so
@subtle blade You're somewhat of a MC genius it seems. Do you have any idea what's going on here?
can you upload it to another site? @naive stratus
"minecraft genius" 
no but really, that's actually fucked lol. I've never seen the portal generate like that before
@subtle blade That's a stamp of approval
Sure, I can upload it somewhere.
I'll include the normal world and nether
Idk if it matters, but better add it just in case.
@fair abyss Did you mean upload somewhere else than imgur or upload the worlds? 😛
else than imgur
Choco is that one percent that will continue charlesdarwinsm of humanity 😮
@fair abyss Sure, but what is the problem with imgur?
second image requires permission
🇶 Is there a way to get the actual fire block from EntityDamageEvent when the DamageCause is FIRE? I checked and made sure that the event was not EntityDamageByBlockEvent. I couldn't find any methods in there that would give the block. Would I need to check the block underneath them?
Try again @fair abyss
THat one is not as important though. That was just to confirm that its the same that was generated earlier. THat part is very distinct.
fire block? @patent monolith
@patent monolith get the livingentity, then get the location ?
I am pretty sure you can get the material from the location.
@naive stratus didnt understand anything abuot your isse or question sorry
you can get block's material from location
but just material, nothing else
Pretty sure you can get the block there as well?
Yeah that's true
about eula
is coding a client with mcp legal?
it says "hacked versions" isn't legal. But im not coding cracked or hacked so is it legal?
you also need to be careful with distributing
you cant distribute a recompiled client for example
@naive goblet yes but mine isnt hacked
just don't distribute a binary
Hacked clients have moved over to a patch system
Not to say you should write one...
though that's most likely the approach you would take if you want to distribute it
mojang is actually going after ppl nowadays
Good. As they should
they pay some company that goes after ppl that miss use the brand
Just waiting for them to finally go after server mirrors. heh.
we have giant list of alt sites aubry already took down
server mirrors arent a problem
so, no problem with coding. but problem with publishing?
server mirrors arent a problem
If that were the case, we'd have a download button lol
Yea I get that
hacked clients are an issue
Just not top priority
those should be prio

nobody gets hurt by distributing server jars
so, optifine is legal?
@naive goblet I can do that, but I want to make sure the correct fire block is damaging the player. I am making a plugin that allows certain fires to heal players
Right - though their patching methods are strange af and, yea, capes
mojangs is reaaaaally unhappy about that
the one thing they don't allow you to sell
the one thing that is supposed to be special
it's just kind of strange to me why damage from a fire block doesnt trigger EntityDamageByBlockEvent
i have confused a bit
you think it would fire it
not mean you
The fire block isn't doing the damage. The fire ticks as a result of the fire block are causing it
Fire increases your fire ticks. Doesn't damage you directly
after obfuscating can I share it with my friends?
no you cant
i also put water on the side and stood between the fire and the water so i wont catch on fire
i was taking damage but wasnt on fire
I will make a test plugin that cancels the EntityCombustEvent to see if the block is the cause of the damage or not
you can share with your friends if you don't do it publicly
no one will notice if you just dm it to a friend you know
so how can optifine do this?
they share it public
optifine says
"OptiFine is a Minecraft optimization mod. It allows Minecraft to run faster and look better with full support for HD textures and many configuration options."
but, isnt it a client too?
@subtle blade yeah, it damages directly
they should add it to the event though... should i open a jira ticket?
optifine isn't a client. it is a client modification @fair abyss
hi, im trying to get this plugin to work properly, i got 2 gui, and in the gui has same items for example i have item Ghast Tear,
and im code the ghast tear to execute command /normalboss
and in naother gui im used the ghast tear too execute the command /hardcoreboss
when i clicked the gui hardcore menu, has same item (Ghast Tear)
it always execute command /normalboss
and i have done code that ghasttear on the gui hardcore tu execute command /hardcoreboss
any silutions ?
talk to me ? king ?
yes you
and different guis should have different name
so you can understand which gui
yea ye ai got the diffrent name , does not work
@fair abyss yes I am sure, it will contain some minecraft code because it needs to modify some things in the client, not just only add to make it work.
@keen compass it contains all, not some
did i typing the code wrong ?
it doesn't contain all @fair abyss there is no way a 5mb jar contains all the mc code for the client
@frigid ember so you say, when I click ghast tear in gui which has name "hardcode boss.." it runs "/normalboss1"?
yea king
mc client is far bigger then 5 or 8mb
this jar doesnt contains assets and libraries
actually any of them contains
if then they will 33mb (1.8.8 tested)
@frigid ember you sure about clicking right menu?
hmm can we private chat / dm discord
using telephone internet currently, sorry.
ok I submitted a jira ticket: https://hub.spigotmc.org/jira/browse/SPIGOT-5734
so wheres debug code? in images you send
dont you say when I click ghast tear in gui which has name "hardcode boss.." it runs "/normalboss1"?
in that image you clicked normal one
when I click ghast tear in gui which has name "hardcode boss.." it runs "/normalboss1"? this one
so must be diffrent items ?
or something
are you really sure about clicked right named gui?